Simple tool to monitor jvm memory usage and garbage collection

5 篇文章 0 订阅
3 篇文章 0 订阅

JDK has built-in tool to monitor jvm memory usage: jstat

This is a command line tool, which runs like:

$ jstat -gc 17707 5000
where, -gc is the option, 17707 is process ID of the jvm process, 5000 is output frequency: every 5 seconds.

 

Following is example output:

 

$ jstat -gc 17707 5000
 S0C       S1C        S0U    S1U      EC           EU             OC             OU            PC            PU           YGC  YGCT  FGC  FGCT    GCT
34944.0 34944.0  0.0   26066.5 279744.0 219021.0  699072.0   250829.1  104640.0 104498.2     47    1.055  16      4.898    5.953
34944.0 34944.0  0.0   26066.5 279744.0 219371.7  699072.0   250829.1  104640.0 104498.3     47    1.055  16      4.898    5.953
34944.0 34944.0  0.0   26066.5 279744.0 232479.2  699072.0   250829.1  104640.0 104498.8     47    1.055  16      4.898    5.953

... ...

34944.0 34944.0 1105.2  0.0   279744.0   216551.2  699072.0   449222.0  104640.0 104587.7     54    1.193  16      4.898    6.090
34944.0 34944.0 1105.2  0.0   279744.0   217444.3  699072.0   449222.0  104640.0 104587.7     54    1.193  16      4.898    6.090
34944.0 34944.0 1105.2  0.0   279744.0   219828.4  699072.0   449222.0  104640.0 104587.7     54    1.193  16      4.898    6.090
34944.0 34944.0 1105.2  0.0   279744.0   220063.1  699072.0   449222.0  104640.0 104587.7     54    1.193  16      4.898    6.090
34944.0 34944.0 1105.2  0.0   279744.0   222029.5  699072.0   449222.0  104640.0 104587.7     54    1.193  16      4.898    6.090
34944.0 34944.0 1105.2  0.0   279744.0   222160.4  699072.0   449222.0  104640.0 104587.7     54    1.193  16      4.898    6.090
34944.0 34944.0 1105.2  0.0   279744.0   222289.1  699072.0   449222.0  104640.0 104587.7     54    1.193  16      4.898    6.090
34944.0 34944.0 1105.2  0.0   279744.0   222417.7  699072.0   449222.0  104640.0 104587.7     54    1.193  16      4.898    6.090
34944.0 34944.0 1105.2  0.0   279744.0   222534.9  699072.0   449222.0  104640.0 104587.7     54    1.193  16      4.898    6.090
34944.0 34944.0 1105.2  0.0   279744.0   222667.3  699072.0   449222.0  104640.0 104587.7     54    1.193  16      4.898    6.090

 

The output unit is KB.

 

S0C: Current (allocated) memory size of the survivor 0 -- stores new objects that survived couple of minor GCs

S1C: Current (allocated) memory size of the survivor 1 -- stores new objects that survived couple of minor GCs

S0U: Used memory size of the survivor 0

S1U: Used memory size of the survivor 1

EC:   Current (allocated) memory size of the Eden -- when object created, it's put into Eden

EU:   Used memory size of the Eden

OC:   Current (allocated) memory size of the Old Generation -- stores objects that survived many minor GCs

OU:   Used memeory of the Old Generation

PC:   Current (allocated) memory size of the Permanent Generation -- stores class meta data and app constants etc

PU:   Used memory of the Permanent Generation

YGC:   Garbage Collection counter for Young Generation memory -- minor GC

YGT:    Time (seconds) used by Garbage Collection for Young Generation memory -- minor GC

FGC:   Major Garbage Collection counter for Old Generation memory - major GC

FGCT: Time used by Major Garbage Collection counter for Old Generation memory

GCT:    Total time used by all Garbage Collection operations

 

 below is diagram of jvm memory modle:

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值