Troubleshooting of high CPU load
Today, a tomcat process has a cpu load of 100%. Follow these steps to identify the cause.
1. Run the top-c command to find the id of the process with the highest cpu
2. Run the top-H-p pid command to display the resource consumption of all threads of the process you just found. Find the thread tid 8627 with high CPU load, and convert the number to hexadecimal, 21B3.
3. Execute jstack-l pid to get the thread dump file of the process. This command will output the running stack of all threads of the process.
4. open the file in notepad and search for "21B3", which is the thread id displayed in hexadecimal notation. After searching, the following stack is produced by this thread. Troubleshoot the problem from here.
The final troubleshooting result today is that "vm thread" consumes the resources of the process. The jvm consumes cpu only. It is easy to think of crazy GC. Search the system log by the keyword "overhead" and find the "GC Overhead" log. The problem is clear. Jvm is in the crazy Full GC, and a large object is always reachable from the Root Node path and cannot be released.
This article permanently updates the link address: