Java虚拟机调优工具 jstack

来源:互联网 发布:电脑图片编辑软件 编辑:程序博客网 时间:2024/05/21 11:13

参考这位大姐的

http://www.cnblogs.com/alipayhutu/archive/2012/08/20/2647353.html

常用具体参数如下:
-class:统计class loader行为信息 
-compile:统计编译行为信息 
-gc:统计jdk gc时heap信息 
-gccapacity:统计不同的generations(包括新生区,老年区,permanent区)相应的heap容量情况 
-gccause:统计gc的情况,(同-gcutil)和引起gc的事件 
-gcnew:统计gc时,新生代的情况 
-gcnewcapacity:统计gc时,新生代heap容量 
-gcold:统计gc时,老年区的情况 
-gcoldcapacity:统计gc时,老年区heap容量 
-gcpermcapacity:统计gc时,permanent区heap容量 
-gcutil:统计gc时,heap情况 
-printcompilation:不知道干什么的,一直没用过。 


一般比较常用的几个用法: 
# jstat -class 17970 1000 10 (每隔1秒监控一次,一共做10次 17970是进程号)  
Loaded  Bytes  Unloaded  Bytes     Time   
  7837  8534.0     1069  1005.7      27.87
Loaded:Number of classes loaded.
Bytes:Number of Kbytes loaded.
Unloaded:Number of classes unloaded.
Bytes:Number of Kbytes unloaded.
Time:Time spent performing class load and unload operations.

# jstat -gc 17970 2000 20 (每隔2秒监控一次,共20次)
# jstat -gcutil 17970 1000 10 (按百分比显式) 
S0C    S1C    S0U    S1U      EC       EU        OC         OU       PC     PU    YGC     YGCT    FGC    FGCT     GCT   
15936.0 15936.0 9030.8  0.0   127872.0 61813.5   901120.0   544712.5  65536.0 35227.8  42078 2796.028  417   498.596 3294.624
S0C:Current survivor space 0 capacity (KB).
S1C:Current survivor space 1 capacity (KB).
S0U:Current survivor space 0 utilization (KB).
S1U:Current survivor space 1 utilization (KB).
EC:Current eden space capacity (KB).
EU:Eden space utilization (KB).
OC:Current old space capacity (KB).
OU:Old space utilization (KB).
PC:Current permanent space capacity (KB).
PU:Permanent space utilization (KB).
YGC:Number of young generation GC Events.
YGCT:Young generation garbage collection time.
FGC:Number of full GC events.
FGCT:Full garbage collection time.
GCT:Total garbage collection time.

0 0
原创粉丝点击