The CPU usage is too high
-
Top Check the CPU usage and find the process whose PID is 123.
-
Top-h-p123 Find two threads with high CPU usage, record PID=2345, 3456 converted to hexadecimal.
-
Jstack -l 123 > temp. TXT Prints the thread stack of the current process.
-
Find the two thread running stacks corresponding to step 2 and analyze the code.
OOM Troubleshooting
Use the top command to query the system status of the server.
-
Ps – aux | grep Java find PID current Java process.
-
Jstat -gcutil pid interval Displays the current GC status.
-
Jmap-histo :live PID Displays the distribution of live objects and the objects that occupy the most memory in descending order.
-
Jmap-dump :format=b,file= file name [pid] Jmap dump is used.
-
Use a performance analysis tool, such as MAT, to analyze the files dumped in the previous step.
This article was published by YBG