The jstat command can view the usage of various parts of the heap memory and the number of loaded classes.
jstat -options view the available parameters as follows
[root@localhost servers]# jstat -options option
-class
-compiler
-gc
-gccapacity
-gccause
-gcmetacapacity
-gcnew
-gcnewcapacity
-gcold
-gcoldcapacity
-gcutil
-printcompilation
jstat -class is used to view class loading information
Loaded Bytes Unloaded Bytes Time
12408 22663.9 0 0.0 11.13
12408 22663.9 0 0.0 11.13
12408 22663.9 0 0.0 11.13
12408 22663.9 0 0.0 11.13
- Loaded Number of loaded classes
- Bytes Loaded class total size
- Unloaded Number of unloaded classes
- Bytes Total size of offload classes
- Time represents the total time spent loading and unloading the class
jstat -compiler for compiling statistics
Compiled Failed Invalid Time FailedType FailedMethod
14276 2 0 54.43 1 com/mysql/jdbc/AbandonedConnectionCleanupThread run
- Compiled: The number of compilations.
- Failed: Number of failures
- Invalid: Invalid quantity
- Time: time
- FailedType: failure type
- FailedMethod: The method that failed
jstat -gc View gc information
jstat -gc 16002
S0C S1C S0U S1U EC EU OC OU MC MU CCSC CCSU YGC YGCT FGC FGCT GCT
512.0 512.0 0.0 320.0 173568.0 82801.1 349696.0 92495.3 72192.0 69136.8 8704.0 8192.9 687 8.424 3 0.408 8.832
- SOC: the size of the first survivor area
- S1C: The size of the second survivor area
- S0U: The used size of the first survivor area
- S1U: The used size of the second survivor area
- EC: Size of Eden Park
- EU: Use size of Eden Park
- OC: old age size
- OU: Old age used size
- MC: Method area size
- MU: Method area usage size
- CCSC: Compressed class space size
- CCSU: Compressed class space usage size
- YGC: Number of young generation garbage collections
- YGCT: Young generation garbage collection consumption time
- FGC: Number of old age garbage collections
- FGCT: Old age garbage collection takes time
- GCT: Total time spent by garbage collection