Get a list of all threads currently running in Java

后端 未结 13 1474
[愿得一人]
[愿得一人] 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:11

    To get a list of threads and their full states using the terminal, you can use the command below:

    jstack -l 
    

    Which is the id of process running on your computer. To get the process id of your java process you can simply run the jps command.

    Also, you can analyze your thread dump that produced by jstack in TDAs (Thread Dump Analyzer) such fastthread or spotify thread analyzer tool.

提交回复
热议问题