- jstat -gc pid time
For example: print jvm usage every 3 seconds
[root@i-5uvhvror bin]# ./jstat -gc 17474 3s S0C S1C S0U S1U EC EU OC OU MC MU CCSC CCSU YGC YGCT FGC FGCT GCT 2560.0 2560.0 1712.5 0.0 2790912.0 1661843.1 5592576.0 230780.6 136704.0 129435.4 15872.0 14462.4 412 5.087 0 0.000 5.087 2560.0 2560.0 1712.5 0.0 2790912.0 1669230.1 5592576.0 230780.6 136704.0 129435.4 15872.0 14462.4 412 5.087 0 0.000 5.087 2560.0 2560.0 1712.5 0.0 2790912.0 1689227.3 5592576.0 230780.6 136704.0 129435.4 15872.0 14462.4 412 5.087 0 0.000 5.087
Explanation of columns:
S0C: total size of the first survival zone in the young generation (KB)
S1C: total size of the second survival zone in the young generation (KB)
S0U: the size of the first survival zone in the young generation is currently in use (KB)
S1U: the size of the third survival area in the young generation is currently used (bytes)
EC: total size of Eden in young generation (KB)
EU: current used size of Eden in younger generation (KB)
OC: total size of the old age (KB)
OU: current used size of the elderly (KB)
MC: total size of Metaspace (KB)
MU: currently used size of Metaspace (KB)
CCSC: total size of compressed class space (KB)
CCSU: compressed space currently used size (KB)
YGC: garbage collection times of young generation
YGCT: total time taken by young generation garbage collection (seconds)
FCG: garbage collection times in the old age
FCGT: total time taken for garbage collection in the old age (seconds)
GCT: total garbage collection time (seconds)
- jstat -gccapacity pid time (view JVM memory allocation)
[root@i-5uvhvror bin]# ./jstat -gccapacity 17474 5s NGCMN NGCMX NGC S0C S1C EC OGCMN OGCMX OGC OC MCMN MCMX MC CCSMN CCSMX CCSC YGC FGC 2796032.0 2796032.0 2796032.0 2560.0 2560.0 2790912.0 5592576.0 5592576.0 5592576.0 5592576.0 0.0 1169408.0 136704.0 0.0 1048576.0 15872.0 429 0 2796032.0 2796032.0 2796032.0 2560.0 2560.0 2790912.0 5592576.0 5592576.0 5592576.0 5592576.0 0.0 1169408.0 136704.0 0.0 1048576.0 15872.0 429 0 2796032.0 2796032.0 2796032.0 2560.0 2560.0 2790912.0 5592576.0 5592576.0 5592576.0 5592576.0 0.0 1169408.0 136704.0 0.0 1048576.0 15872.0 429 0 2796032.0 2796032.0 2796032.0 2560.0 2560.0 2790912.0 5592576.0 5592576.0 5592576.0 5592576.0 0.0 1169408.0 136704.0 0.0 1048576.0 15872.0 429 0
Explanation of each column:
NGCMN: the size of young generation initialization (minimum) (KB)
NGCMX: the largest capacity of young generation (KB)
NGC: current capacity in young generation (KB)
S0C: the capacity of the first surviving area in the young generation (KB)
S1C: capacity of the third surviving area in the young generation (KB)
EC: capacity of Eden District in young generation (KB)
OGCMN: size of initialization capacity in the elderly (KB)
OGCMX: the largest capacity in the elderly (KB)
OGC: current capacity size of the old age (KB)
Mcmn: metaface initialization capacity (KB)
Mcmx: maximum capacity size of metasface (KB)
MC: current capacity size of metaface (KB)
- jstat -gcutil pid time (view current JVM memory usage percentage)
[root@i-5uvhvror bin]# ./jstat -gcutil 17474 5s S0 S1 E O M CCS YGC YGCT FGC FGCT GCT 61.88 0.00 72.14 4.20 94.73 91.12 434 5.326 0 0.000 5.326 61.88 0.00 73.49 4.20 94.73 91.12 434 5.326 0 0.000 5.326 61.88 0.00 74.73 4.20 94.73 91.12 434 5.326 0 0.000 5.326 61.88 0.00 75.69 4.20 94.73 91.12 434 5.326 0 0.000 5.326 61.88 0.00 77.52 4.20 94.73 91.12 434 5.326 0 0.000 5.326 61.88 0.00 78.85 4.20 94.73 91.12 434 5.326 0 0.000 5.326
Explanation of each column:
S0: percentage of the current capacity of the first surviving area in the young generation
S1: the second surviving area in the young generation has been used as a percentage of the current capacity
E: Percentage of current capacity used in Eden area in young generation
O: Percentage of current capacity used by the elderly
M: Percentage of the current capacity of the used measurement point of metasface
- jstat -gcnew pid time (information about younger generation objects)
[root@i-5uvhvror bin]# ./jstat -gcnew 17474 3s S0C S1C S0U S1U TT MTT DSS EC EU YGC YGCT 2560.0 2560.0 0.0 2234.5 1 15 2560.0 2790912.0 1544776.3 435 5.339 2560.0 2560.0 0.0 2234.5 1 15 2560.0 2790912.0 1548682.9 435 5.339 2560.0 2560.0 0.0 2234.5 1 15 2560.0 2790912.0 1569876.3 435 5.339 2560.0 2560.0 0.0 2234.5 1 15 2560.0 2790912.0 1592029.9 435 5.339