Get a list of all threads currently running in Java

后端 未结 13 1484
[愿得一人]
[愿得一人] 2020-11-22 02:30

Is there any way I can get a list of all running threads in the current JVM (including the threads not started by my class)?

Is it also possible to get the

13条回答
  •  攒了一身酷
    2020-11-22 03:25

    You can get a lot of information about threads from the ThreadMXBean.

    Call the static ManagementFactory.getThreadMXBean() method to get a reference to the MBean.

提交回复
热议问题