How to get the number of threads in a Java process

后端 未结 9 786
无人及你
无人及你 2020-12-07 19:49

How can I see the number of threads in a Java process?

9条回答
  •  南方客
    南方客 (楼主)
    2020-12-07 20:25

    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()

提交回复
热议问题