Use top to locate that process whose cpu occupancy is too high, and find the pid that occupies too high
top
When using the ps command to further locate which thread caused the cpu usage to be too high
ps H -eo pid,tid,%cpu | grep 进程id
jstack process id
jstack 32655
The problematic thread can be found according to the thread id, and the source line number of the problem code can be further located.
Use a calculator to convert the thread number 32665 to hexadecimal. The result is 7F99
. Find the value of nid in the reported exception and you can find the location of the corresponding code error.
Our online code may also be deadlocked. The same page can use jstack process id to diagnose
jstack 32752
A deadlock occurred while observing the output