Detailed explanation of jstat commands and display results, and detailed explanation of jstat commands
Reference Original:
Http://blog.163.com/yangshuo_qq/blog/static/2554680201272871350110/
Http://zizihaier.iteye.com/blog/1157245
Jstat
1. jstat-gc pid
The gc information is displayed, and the gc count and time are displayed.
The last five items are the young gc count, young gc time, full gc count, full gc time, and total gc time.
2. jstat-gccapacity pid
The usage and usage of three generations (young, old, perm) objects in VM memory are displayed,
For example, pgcen displays the minimum memory usage of perm, while PGCMX displays the maximum memory usage of perm,
PGC is the memory usage of the newly generated perm, while PC is the memory usage of the previous perm.
For others, the OC usage is pure in old.
3. jstat-gcutil pid
Collect gc statistics.
4. jstat-gcnew pid
The information of the young object.
5. jstat-gcnewcapacity pid
The information and usage of the young object.
6. jstat-gcold pid
Old generation object information.
7. stat-gcoldcapacity pid
The information and usage of the old object.
8. jstat-gcpermcapacity pid
Perm object information and usage.
9. jstat-class pid
Displays the number of loaded classes and the occupied space.
10. jstat-compiler pid
Displays information such as the number of VM real-time compilations.
11. stat-printcompilation pid
Information of the current VM execution.
Chinese explanations of some terms:
S0C: the capacity (in bytes) of the first surviving vor in the young generation)
S1C: the capacity (in bytes) of the second surviving vor in the young generation)
S0U: The first surviving vor in the young generation. Currently, space (in bytes) is used)
S1U: The second surviving vor in the young generation. Currently, space (in bytes) is used)
EC: Capacity (bytes) of Eden in the young generation)
EU: the young generation of Eden (Eden) currently uses space (bytes)
OC: the size of the Old generation (in bytes)
OU: the Old generation currently uses space (in bytes)
PC: Perm (persistent generation) Capacity (bytes)
PU: Perm (persistent generation) Space (bytes) used currently)
YGC: Number of gc times in the young generation from application startup to sampling
YGCT: gc time in the young generation from application startup to sampling (s)
FGC: Number of gc times of the old generation (full gc) from application startup to sampling
FGCT: the time (s) taken by the old generation (full gc) gc from application startup to sampling)
GCT: Total gc time from application startup to sampling (s)
Ngcen: size (in bytes) of the initialization (minimum) in young generation (young)
NGCMX: Maximum capacity (bytes) of young generation)
NGC: current capacity (bytes) in young generation (young)
Size (in bytes) of the initialization (minimum) in the old generation)
OGCMX: the maximum size (in bytes) of the old generation)
OGC: the capacity (in bytes) generated by the old generation)
Pgcen: the minimum size (in bytes) of the initialization in the perm generation)
PGCMX: Maximum capacity (bytes) of the perm generation)
PGC: the capacity (in bytes) generated by the perm generation)
S0: Percentage of the first surviving vor in the young generation used in the current capacity
S1: Percentage of used vor In the second surviving zone of the young generation in the current capacity
E: Percentage of Eden (Eden) used in the young generation in the current capacity
O: Percentage of used by the old generation to the current capacity
P: Percentage of the used perm generation to the current capacity
S0CMX: Maximum capacity (in bytes) of the first surviving vor in the young generation)
S1CMX: Maximum capacity (in bytes) of the second surviving vor in the young generation)
ECMX: the maximum capacity (in bytes) of Eden in the young generation)
DSS: the capacity (in bytes) of the active VOR (the Eden zone is full)
TT: the maximum number of Hold times.
MTT: Maximum number of Hold times limit
Sun official documentation
Http://download.oracle.com/javase/1.5.0/docs/tooldocs/share/jstat.html
Refs: http://hi.baidu.com/savagert/item/6a056619d25bb6426926bb38
Below isjstat -gcutil pid 2000
Result
S0: Percentage of used space in shard vor space 0 on Heap
S1: Percentage of used space in Segment 1 of physical vor space on Heap
E: Percentage of space used by the Eden space segment on the Heap
O: Percentage of space used by the Old space segment on the Heap
P: Percentage of space used by Perm space
YGC: Number of Young GC times from program startup to sampling
YGCT: the time used by Young GC (unit: seconds)
FGC: number of Full GC times from program startup to sampling
FGCT: the time used for Full GC (unit: seconds)
GCT: Total time used for garbage collection (unit: seconds)
Let's talk about the basic operations of garbage collection GC.
First, GC divides the memory into four blocks: old generation (the old generation), eden (the young generation), Alibaba vor space1 (ss1), Alibaba vor space0 (ss0 ). when declaring a variable, the variable is first declared in the young generation, and then when the young generation is filled up, secondary garbage collection occurs, and the surviving objects are copied to SS1, then empty the young generation.
Continue to declare objects in eden. When eden fills up again, secondary garbage collection occurs again. This time, the content of ss1 is calculated for survival. If it is long, it is copied to the old generation, the other alive instances are copied to ss0, ss1 is cleared, and eden is collected as a secondary garbage collection.
When the old generation was also filled up, a major garbage collection was generated, which was very time-consuming.
PermGen space stands for Permanent Generation space, which is the Permanent storage area of the memory.
OutOfMemoryError: PermGen space. On the surface, memory overflow occurs. The solution must increase the memory. Why is memory overflow? This part is used to store Class and Meta information. When the Class is loaded, it is placed in the PermGen space area. It is different from the Heap area where the Instance is stored, GC (Garbage Collection) does not clean up the PermGen space during the main program running period. Therefore, if your APP loads many classes, the PermGen space error may occur. This error is often seen when the web server pre-compile JSP.