How can I see the number of threads in a Java process?
The java. lang. Thread. activeCount() method returns the number of active threads in the current thread's thread group.
java.lang.Thread.activeCount()
It will return the number of active threads in the current thread's thread group.
docs: http://docs.oracle.com/javase/7/docs/api/java/lang/Thread.html#activeCount()
ManagementFactory.getThreadMXBean().getThreadCount()
doesn't limit itself to thread groups as Thread.activeCount()
does.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With