The Jstat command uses
The Jstat command can see how much of the heap memory is being used, and how many classes are loaded. The format of the command is as follows:
Jstat [-Command options] [Vmid] [interval time/MS] [query count]
Note: The JDK version used is jdk8.
Class Load Statistics:
C:\Users\Administrator>jstat -class 2060Loaded Bytes Unloaded Bytes Time 15756 17355.6 0 0.0 11.29
- Loaded: The number of loaded class
- Bytes: The amount of space occupied
- Unloaded: Quantity not loaded
- Bytes: Unoccupied Space not loaded
- Time:
Compiling statistics
C:\Users\Administrator>jstat -compiler 2060Compiled Failed Invalid Time FailedType FailedMethod 9142 1 0 5.01 1 org/apache/felix/resolver/ResolverImpl mergeCandidatePackages
- Compiled: Number of compilations.
- Failed: Number of failures
- Invalid: Quantity Not Available
- Time:
- Failedtype: Failure type
- Failedmethod: Method of failure
Garbage collection Statistics
C:\Users\Administrator>jstat -gc 2060 S0C S1C S0U S1U EC EU OC OU MC MU CCSC CCSU YGC YGCT FGC FGCT GCT20480.0 20480.0 0.0 13115.3 163840.0 113334.2 614400.0 436045.7 63872.0 61266.5 0.0 0.0 149 3.440 8 0.295 3.735
- S0C: The size of the first surviving area
- S1C: The size of the second surviving area
- S0U: The use size of the first surviving area
- S1U: The use size of the second surviving area
- EC: Size of the Eden District
- EU: The use of the Eden area size
- OC: old age Size
- OU: old age Use size
- MC: Method Area Size
- MU: Method Area Use size
- CCSC: Compression class space size
- CCSU: Compression class space usage size
- YGC: Number of young generations of garbage collection
- YGCT: Waste collection time for young generation
- FGC: Garbage collection times in the old age
- FGCT: Time spent on garbage collection in the old age
- GCT: Total time spent on garbage collection
Heap Memory statistics
C:\Users\Administrator>jstat -gccapacity 2060 NGCMN NGCMX NGC S0C S1C EC OGCMN OGCMX OGC OC MCMN MCMX MC CCSMN CCSMX CCSC YGC FGC204800.0 204800.0 204800.0 20480.0 20480.0 163840.0 614400.0 614400.0 614400.0 614400.0 0.0 63872.0 63872.0 0.0 0.0 0.0 149 8
- NGCMN: Cenozoic Minimum capacity
- NGCMX: Maximum capacity of the Cenozoic
- NGC: Current Cenozoic capacity
- S0C: Size of the first surviving area
- S1C: The size of the second surviving area
- EC: Size of the Eden District
- OGCMN: The old age minimum capacity
- OGCMX: Maximum capacity of the old age
- OGC: Current old age size
- OC: Current old age size
- MCMN: Minimum meta-data capacity
- MCMX: Maximum meta data capacity
- MC: Current meta-data space size
- CCSMN: Minimum compression class space size
- Ccsmx: Maximum compression class space size
- CCSC: Current Compression class space size
- YGC: Young Generation GC Number
- FGC: Number of GC times in the old age
New Generation garbage Collection statistics
C:\Users\Administrator>jstat -gcnew 7172 S0C S1C S0U S1U TT MTT DSS EC EU YGC YGCT40960.0 40960.0 25443.1 0.0 15 15 20480.0 327680.0 222697.8 12 0.736
- S0C: Size of the first surviving area
- S1C: The size of the second surviving area
- S0U: The use size of the first surviving area
- S1U: The use size of the second surviving area
- TT: Number of objects surviving in the Cenozoic
- MTT: Maximum number of objects surviving in the Cenozoic
- DSS: Desired Surviving area size
- EC: Size of the Eden District
- EU: The use of the Eden area size
- YGC: Number of young generations of garbage collection
- YGCT: Waste collection time for young generation
Cenozoic Memory Statistics
C:\Users\Administrator>jstat -gcnewcapacity 7172 NGCMN NGCMX NGC S0CMX S0C S1CMX S1C ECMX EC YGC FGC 409600.0 409600.0 409600.0 40960.0 40960.0 40960.0 40960.0 327680.0 327680.0 12 0
- NGCMN: Cenozoic Minimum capacity
- NGCMX: Maximum capacity of the Cenozoic
- NGC: Current Cenozoic capacity
- S0CMX: Maximum surviving 1 zone size
- S0C: Currently surviving 1 area size
- S1CMX: Maximum surviving 2 zone size
- S1C: Currently surviving 2 area size
- ECMX: Max Eden Area Size
- EC: Current Eden Area Size
- YGC: Number of young generations of garbage collection
- FGC: Number of recoveries in the old age
Garbage collection statistics in the old age
C:\Users\Administrator>jstat -gcold 7172 MC MU CCSC CCSU OC OU YGC FGC FGCT GCT 33152.0 31720.8 0.0 0.0 638976.0 184173.0 12 0 0.000 0.736
- MC: Method Area Size
- MU: Method Area Use size
- CCSC: Compression class space size
- CCSU: Compression class space usage size
- OC: old age Size
- OU: old age Use size
- YGC: Number of young generations of garbage collection
- FGC: Garbage collection times in the old age
- FGCT: Time spent on garbage collection in the old age
- GCT: Total time spent on garbage collection
Memory statistics for the old age
C:\Users\Administrator>jstat -gcoldcapacity 7172 OGCMN OGCMX OGC OC YGC FGC FGCT GCT 638976.0 638976.0 638976.0 638976.0 12 0 0.000 0.736
- OGCMN: The old age minimum capacity
- OGCMX: Maximum capacity of the old age
- OGC: Current old age size
- OC: old age Size
- YGC: Number of young generations of garbage collection
- FGC: Garbage collection times in the old age
- FGCT: Time spent on garbage collection in the old age
- GCT: Total time spent on garbage collection
Meta Data Spatial statistics
C:\Users\Administrator>jstat -gcmetacapacity 7172 MCMN MCMX MC CCSMN CCSMX CCSC YGC FGC FGCT GCT 0.0 33152.0 33152.0 0.0 0.0 0.0 12 0 0.000 0.736
- MCMN: Minimum meta-data capacity
- MCMX: Maximum meta data capacity
- MC: Current meta-data space size
- CCSMN: Minimum compression class space size
- Ccsmx: Maximum compression class space size
- CCSC: Current Compression class space size
- YGC: Number of young generations of garbage collection
- FGC: Garbage collection times in the old age
- FGCT: Time spent on garbage collection in the old age
- GCT: Total time spent on garbage collection
Summarize garbage collection statistics
C:\Users\Administrator>jstat -gcutil 7172 S0 S1 E O M CCS YGC YGCT FGC FGCT GCT 62.12 0.00 81.36 28.82 95.68 - 12 0.736 0 0.000 0.736
- S0: Survival Zone 1 Current usage ratio
- S1: Survival Zone 2 Current usage ratio
- E: Eden Area usage ratio
- O: Proportions used in the old age
- M: Meta data Area usage scale
- CCS: Compression usage ratio
- YGC: Number of young generations of garbage collection
- FGC: Garbage collection times in the old age
- FGCT: Time spent on garbage collection in the old age
- GCT: Total time spent on garbage collection
JVM Compilation Method Statistics
7172Compiled Size Type Method 4608 16 1 org/eclipse/emf/common/util/SegmentSequence$SegmentSequencePool$SegmentsAccessUnit reset
- Compiled: Number of recently compiled methods
- Size: Number of bytecode for the most recently compiled method
- Type: The compilation types of the most recently compiled methods.
- Method: Name identification.
Jstat Monitoring and Tuning GC is very useful