Last Updated: February 25, 2016
·
1.339K
· groodt

Count of WAITING Threads in JVM

If you ever need to monitor the number of WAITING Threads in a JVM, you can do something like:

jstack <PID> | grep "java.lang.Thread.State: WAITING" | wc -l

Of course, you can substitute in any of the other Thread states you might be interested in.