Which Java thread is hogging the CPU?

前端 未结 12 1750
萌比男神i
萌比男神i 2020-12-07 07:48

Let\'s say your Java program is taking 100% CPU. It has 50 threads. You need to find which thread is guilty. I have not found a tool that can help. Currently I use the follo

12条回答
  •  暖寄归人
    2020-12-07 08:27

    If you suspect VisualVM is a good tool, try it (because it does this) Find out the threads(s) only helps you in the general direction of why it is consuming so much CPU.

    However, if its that obvious I would go straight to using a profiler to find out why you are consuming so much CPU.

提交回复
热议问题