1. Find out the Java process PID, such as 11327
2. Using Jstack to see the lock holding situation
/usr/java/latest/bin/jstack-l 11327
3. Output Java stack information, and C + + stack information
/usr/java/latest/bin/jstack-m 11327
4. Find the most CPU-consuming thread
TOP-HP 11327
Find out 11341 time consuming the longest
5. Convert the thread ID to hexadecimal
printf "%x\n" 11341
The result is: 2c4d
6. Filter the stack information corresponding to the thread
/usr/java/latest/bin/jstack 11327 |grep 2c4d
7. Use Jmap to view process heap memory usage, including GC algorithms, heap configuration parameters, and heap memory usage in each generation
/usr/java/latest/bin/jmap-heap 11327
8. Use Jmap to view the number of objects in the heap memory, the size statistics histogram, and if you bring live, only live objects are counted, as follows:
/usr/java/latest/bin/jmap-histo:live 11327 | More
These are the commands and parameters used in the analysis process,
Java Process Analysis