Jstat查看JVM统计信息
命令格式
options: -class ,-compliler,-gc,-printcompilation
类装载:
[[email protected] bin]# ./jstat -class 18692
Loaded Bytes Unloaded Bytes Time
16934 34342.0 72 106.7 361.47
Class loader statistics.
Loaded: Number of classes loaded. //加载的类的个数
Bytes: Number of kBs loaded. //加载了多个k
Unloaded: Number of classes unloaded. //卸载的类的个数
Bytes: Number of Kbytes unloaded. //卸载了多个k
Time: Time spent performing class loading and unloading operations. //类加载和类卸载的时间
[[email protected] bin]# ./jstat -class 18692 1000 10
Loaded Bytes Unloaded Bytes Time
16934 34342.0 72 106.7 361.47
16934 34342.0 72 106.7 361.47
16934 34342.0 72 106.7 361.47
16934 34342.0 72 106.7 361.47
16934 34342.0 72 106.7 361.47
16934 34342.0 72 106.7 361.47
16934 34342.0 72 106.7 361.47
16934 34342.0 72 106.7 361.47
每隔1秒打印1次,共输出10次
垃圾收集
-gc -gcutil -gccause -gcnew -gclod
[[email protected] bin]# ./jstat -gc 18692
S0C S1C S0U S1U EC EU OC OU MC MU CCSC CCSU YGC YGCT FGC FGCT GCT
34944.0 34944.0 0.0 11177.6 279744.0 5863.7 699072.0 227001.6 109952.0 107869.1 12672.0 12211.7 53 2.253 4 0.887 3.140
[[email protected] bin]# ./jstat -gc 18692 1000 10
……
-gc option
Garbage-collected heap statistics.
S0C: Current survivor space 0 capacity (kB). S0的总量
S1C: Current survivor space 1 capacity (kB). S1的总量
S0U: Survivor space 0 utilization (kB). //S0使用量
S1U: Survivor space 1 utilization (kB). //S1使用量
EC: Current eden space capacity (kB). //Eden区总量
EU: Eden space utilization (kB). //Eden区使用量
OC: Current old space capacity (kB). //Old区总量
OU: Old space utilization (kB). //Old区使用量
MC: Metaspace capacity (kB). // Metacspace区总量
MU: Metacspace utilization (kB). // Metacspace区使用量
CCSC: Compressed class space capacity (kB). // 压缩类空间的总量
CCSU: Compressed class space used (kB). // 压缩类空间的使用量
YGC: Number of young generation garbage collection events. YoungGC的次数
YGCT: Young generation garbage collection time. YoungGC的时间
FGC: Number of full GC events. FullGC的次数
FGCT: Full garbage collection time. FullGC的时间
GCT: Total garbage collection time. 总的GC时间
Young=S0+S1+Eden
堆区=Young区+Old区
S0和S1在同一时间点上只会启动1个
非堆区:操作系统的本地内存,独立于JVM之外的
CCS:启用短指针时用到
CodeCache:git的代码信息,java代码转换为Native代码
JIT编译:
-compiler -printcompilation
[[email protected] bin]# ./jstat - compiler 18692
Compiled
: Number of compilation tasks performed. //完成的编译任务数(编译成本地方法)
Failed
: Number of compilations tasks failed. //失败的任务数
Invalid
: Number of compilation tasks that were invalidated. //无效的任务数
Time
: Time spent performing compilation tasks. //编译的时间
FailedType
: Compile type of the last failed compilation.
FailedMethod
: Class name and method of the last failed compilation.//失败的方法