The CPU usage is too high

  1. Top Check the CPU usage and find the process whose PID is 123.

  2. Top-h-p123 Find two threads with high CPU usage, record PID=2345, 3456 converted to hexadecimal.

  3. Jstack -l 123 > temp. TXT Prints the thread stack of the current process.

  4. 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.

  1. Ps – aux | grep Java find PID current Java process.

  2. Jstat -gcutil pid interval Displays the current GC status.

  3. Jmap-histo :live PID Displays the distribution of live objects and the objects that occupy the most memory in descending order.

  4. Jmap-dump :format=b,file= file name [pid] Jmap dump is used.

  5. Use a performance analysis tool, such as MAT, to analyze the files dumped in the previous step.

This article was published by YBG