Analysis of the problem of high CPU usage in java applications

Use top to query which process occupies the most CPU

. Check CPU use.

You can check in the following three ways:

1. Press SHIFT+H in top to find which thread occupies the most.
2. top -H -p PID command Check which thread takes up
3 ps -mp PID -o THREAD,tid,time
Convert thread id to hexadecimal

printf "%X\n" thread_id
Export all thread information of the process

Use jstack PID to export all thread information under process , and use the hexadecimal thread ID obtained in the previous step to find the status information of the problem thread.

You can also find the problem thread information in the following way:

jstack PID | grep hexadecimal ID of the thread

rotor:
     http://www.cnblogs.com/coderland/p/5902649.html

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326300937&siteId=291194637