1. A computer implemented method for collecting information about threads, the computer implemented method comprising: detecting a thread entering a wait state; and selectively obtaining information about a set of threads in the wait state using a policy in response to the thread entering the wait state.