[root@c100 ~]# jps |grep jar 2181jar
[root@c100 ~]# top -Hp 2181
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 2181 root 20 0 2322404 537720 11620 S 0.0 13.8 0:00.02 java 2182 root 20 0 2322404 537720 11620 S 0.0 13.8 0:00.39 java 2183 root 20 0 2322404 537720 11620 S 0.0 13.8 0:00.34 java 2184 root 20 0 2322404 537720 11620 S 0.0 13.8 0:00.34 java 2185 root 20 0 2322404 537720 11620 S 0.0 13.8 0:00.19 java
[root@c100 ~]# printf "%x\n" 2182 886
[root@c100 ~]# jstack 2181 | grep 886 "DestroyJavaVM" prio=10 tid=0x00007f6564008800 nid=0x886 waiting on condition [0x0000000000000000]
輸出:類加載器名稱、對象是否存活(不可靠)、對象地址、父類加載器、已加載的類大小等信息java
jmap -permstat 2181
jmap -heap 2181
jmap -histo:live 2181 | more
jmap -dump:format=b,file=/tmp/dump.dat 2181 jhat -port 10086 /tmp/dump.dat
語法格式以下
jstat [ generalOption | outputOptions vmid [interval[s|ms] [count]] ]
[root@c100 ~]# jstat -gc 2181 500 10 S0C S1C S0U S1U EC EU OC OU PC PU YGC YGCT FGC FGCT GCT 11776.0 11264.0 0.0 0.0 300544.0 4120.7 78336.0 37001.1 68608.0 35256.5 15 0.309 2 0.558 0.866 11776.0 11264.0 0.0 0.0 300544.0 4120.7 78336.0 37001.1 68608.0 35256.5 15 0.309 2 0.558 0.866 11776.0 11264.0 0.0 0.0 300544.0 4120.7 78336.0 37001.1 68608.0 35256.5 15 0.309 2 0.558 0.866 11776.0 11264.0 0.0 0.0 300544.0 4120.7 78336.0 37001.1 68608.0 35256.5 15 0.309 2 0.558 0.866 11776.0 11264.0 0.0 0.0 300544.0 4120.7 78336.0 37001.1 68608.0 35256.5 15 0.309 2 0.558 0.866