jstat 查看JVM统计信息
命令格式
文档
[root@jvm001 ~]# jstat -help
Usage: jstat -help|-options
jstat -<option> [-t] [-h<lines>] <vmid> [<interval> [<count>]]
Definitions:
<option> An option reported by the -options option
<vmid> Virtual Machine Identifier. A vmid takes the following form:
<lvmid>[@<hostname>[:<port>]]
Where <lvmid> is the local vm identifier for the target
Java virtual machine, typically a process id; <hostname> is
the name of the host running the target Java virtual machine;
and <port> is the port number for the rmiregistry on the
target host. See the jvmstat documentation for a more complete
description of the Virtual Machine Identifier.
<lines> Number of samples between header lines.
<interval> Sampling interval. The following forms are allowed:
<n>["ms"|"s"]
Where <n> is an integer and the suffix specifies the units as
milliseconds("ms") or seconds("s"). The default units are "ms".
<count> Number of samples to take before terminating.
-J<flag> Pass <flag> directly to the runtime system.
- options: -class, -compiler, -gc, -printcompilation
示例
查看tomcat进程的类加载信息
- Loaded:加载的类的个数;
- Bytes:加载的类多少个k
- 1000:每隔多少毫秒显示一次;
- 10:一共显示几次;
[root@jvm001 ~]# jstat -class 732
Loaded Bytes Unloaded Bytes Time
2684 5314.3 0 0.0 1.65
[root@jvm001 ~]# jstat -class 732 1000 10
Loaded Bytes Unloaded Bytes Time
2684 5314.3 0 0.0 1.65
2684 5314.3 0 0.0 1.65
2684 5314.3 0 0.0 1.65
2684 5314.3 0 0.0 1.65
2684 5314.3 0 0.0 1.65
2684 5314.3 0 0.0 1.65
2684 5314.3 0 0.0 1.65
2684 5314.3 0 0.0 1.65
2684 5314.3 0 0.0 1.65
2684 5314.3 0 0.0 1.65
查看tomcat进程的垃圾收集信息
- C:capacity;
- U:used;
- C和U前面的是每个内存区的编号;
[root@jvm001 ~]# jstat -gc 732 1000 3
S0C S1C S0U S1U EC EU OC OU MC MU CCSC CCSU YGC YGCT FGC FGCT GCT
960.0 960.0 0.0 10.1 7744.0 5197.2 19196.0 14150.8 16768.0 16223.6 1920.0 1814.2 13 0.053 1 0.021 0.074
960.0 960.0 0.0 10.1 7744.0 5197.2 19196.0 14150.8 16768.0 16223.6 1920.0 1814.2 13 0.053 1 0.021 0.074
960.0 960.0 0.0 10.1 7744.0 5282.0 19196.0 14150.8 16768.0 16223.6 1920.0 1814.2 13 0.053 1 0.021 0.074
查看tomcat进程的JIT编译信息
[root@jvm001 ~]# jstat -compiler 732
Compiled Failed Invalid Time FailedType FailedMethod
1776 1 0 3.30 1 org/apache/tomcat/util/IntrospectionUtils setProperty