System CPU soars three steps to quickly locate the problem

One: Find the process that consumes the most CPU

top -c

 

Two: Find the thread that consumes the most CPU 

top -Hp <pid>

Enter the command: top -Hp 8 

 

Three: View stack information

jstack <进程pid> | grep '<16进制的线程pid>' -C100 --color

Here to view the stack information with PID 97, first convert 97 to hexadecimal (command: printf "%x\n" <pid>), the result is 0x61 

Enter the command: jstack 8 | grep '0x61' -C100 --color

 

Guess you like

Origin blog.csdn.net/Anenan/article/details/129242784