Soar soared CPU and memory generally higher processing steps such as

soar processing step cpu

  1. Find out the top CPU high (top -c) which process consumes

  2. top -h -p to find out which thread consumed cpu high (top -h -p pid)

This command can display the resource consumption of all threads of the process just found.

  1. printf% x be the base for the conversion pid

Find high CPU load thread pid 8627, this figure is converted to hexadecimal, 21B3 (10 hex 16 hex transfer, use linux command: printf% x 8627)

  1. Jstack stack information recording process

Execution jstack -l pid, the process to get the thread dump file. This command will play all the threads to run the stack of the process.

  1. Thread information to identify the highest consumption of CPU

Search "21B3", was found about 16 hex thread id displayed. After the search, the following stack is playing out of this thread.

Memory soar processing step

  1. jstat command to check the time consumed and the number of FGC occurs, the more the number, the longer the time-consuming indicate a problem;

Jstat command can be observed classloader, compiler, gc information. You can constantly monitor resources and performance

  1. View jmap -heap continuous occupancy View Older Generation, the greater the problems change program;

Jmap command (jmap [option] pid) to give details of the memory allocation run java program. Number of instances, for example, size, etc.

  1. Use continuous jmap -histo: live command to export the file, load an object than the difference, the difference is usually part where the problem is.

Mononuclear soared due to high GC

  1. Single CPU occupancy rate, first check from the GC.

Common SY soar

1. frequent thread context switching

  1. Too many threads

  2. Lock competition

IO soar

  1. If the CPU usage is high IO, the investigation relates to the IO program, such as the OIO transformed into NIO.

Jitter problems

The reason: the bytecode into machine code required CPU time slice, a lot of CPU in the implementation of the byte code, causes the CPU to remain high for long;

Phenomenon: "C2 CompilerThread1" daemon, "C2 CompilerThread0" highest CPU utilization daemon;

Solution: to ensure that the proportion of CPU to compile threads.

Published 44 original articles · won praise 20 · views 1807

Guess you like

Origin blog.csdn.net/qq_45019159/article/details/104258728