In addition to writing business code, especially after the project goes online, Java programmers need to pay more attention to the performance of the system. At this time, they need to understand the performance of the JVM. With the help of some analysis tools of Java virtual machine, there are mainly three common commands.
&Nbsp; & nbsp; this command is used to view the heap dump of the JVM process in the current system, including the number of objects and the memory occupied by the objects
&Nbsp; & nbsp; usage: use JPS to view the process ID first
Use jmap – dump: live, file = b.map 22467 to generate a Java heap dump snapshot of the live process
We can see the percentage of space use on the new generation of survivor S0, survivor S1 heap, the percentage of space use on the new generation of Eden in the heap, the percentage of old space use on the old generation of the old generation, the percentage of memory use, the statistical times of the new generation of Yong GC, the time spent on the new generation of GC, the times spent on the full GC, the time spent, and the total GC time of the current process. Here we should pay attention to one point, Full GC is very representative. The number and time indexes of full GC can show the system performance problems. These two indexes are very large, which largely shows that there are problems in the program and the garbage can not be recycled
Jstack PID can be used to analyze the process