1. A method of deadlock detection, comprising: collecting statistics of a frequency of deadlocks detected for one or more resources in a system; based on the statistics, adjusting a threshold timeout value that controls an initiation of a search for a deadlock, wherein adjusting the threshold timeout value comprises; based on the statistics, determining the frequency of deadlocks detected for the one or more resources; comparing a threshold deadlock occurrence rate to the frequency of deadlocks detected for the one or more resources; based on said comparison, adjusting the threshold timeout value to change a frequency of performing searches for deadlocks; if a waiting time associated a the lock exceeds the threshold timeout value, initiating the search for the deadlock based on the lock; and wherein the method is performed by one or more computing devices.