JVM监控功能工具jstat的使用
格式
jstat [ generalOption | outputOptions vmid [interval[s|ms] [count]] ]
GeneralOption
-help:显示帮助信息
-version:显示版本
-options:显示所有的statOption
如果指定了generalOption, 那么就不能再指定outputOptions了
OutputOption
格式:[ statOption [ -t | -h | -J ]
-t:输出结果加上timestamp列,值为自jvm启动的时长(秒)
-h n:每输出n行数据就输出一行头信息,用于多次输出时
-JjavaOption:Passes javaOption to the Java application launcher. For example, -J-Xms48m sets the startup memory to 48 MB. For a complete list of options
outputOption决定输出的内容以及格式, 由statOption和otherOutputOption(-t, -h, -J)组成, statOption必须放在前面
StatOption
-class
显示class loader的信息
Loaded:已加载的类个数
Bytes:已加载字节(Kbytes,千字节)
Unloaded:已卸载的类个数
Bytes:已卸载字节(Kbytes,千字节)
Time:用于类加载及卸载所用的总时间
-compiler
显示JIT的统计信息
Compiled:Number of compilation tasks performed
Failed:Number of compilation tasks that failed
Invalid:Number of compilation tasks that were invalidated
Time:Time spent performing compilation tasks
FailedType:Compile type of the last failed compilation