JVM性能调优3:JVM_堆溢出分析过程和命令


本系列包括:





1    查看JVM状态信息jstat命令格式

        jstat-option -t -h num pid interval count

        -option:参数

        -t打印收集信息的时间

        -hnum行打印一个head

        pid监控的进程号

        interval间隔多少毫秒采集一次信息

        count一共采集多少次信息。

2    分析过程命令

        (1)查看JVM启动参数和进程号

                  jps -mlvV

        (2)看堆内存分配情况

                  jstat -gccapacity -t -h 5 2808 100 10

 

        (3)看垃圾回收情况

                  jstat -gcutil -t -h 5 2808 100 10

                  jstat -gccause -t -h 5 2808 100 10

                  

                  -gcutil:查看堆内存占用和回收情况。

                  -gccause:查看最近一次垃圾回收原因。

 

 (4)如果堆内存持续占用率很高,查看堆内存内对象情况

     jmap-histo pid

     

 (5)如果向查看更多信息,在cmd里运行jstat查看jstat的其他参数。

 

 (6)更多的资料信息,请上网查询查找。

 

3    附录

1jstat –gccapacity 输出结果

Column

Description

NGCMN

Minimum new generation capacity (KB).

NGCMX

Maximum new generation capacity (KB).

NGC

Current new generation capacity (KB).

S0C

Current survivor space 0 capacity (KB).

S1C

Current survivor space 1 capacity (KB).

EC

Current eden space capacity (KB).

OGCMN

Minimum old generation capacity (KB).

OGCMX

Maximum old generation capacity (KB).

OGC

Current old generation capacity (KB).

OC

Current old space capacity (KB).

PGCMN

Minimum permanent generation capacity (KB).

PGCMX

Maximum Permanent generation capacity (KB).

PGC

Current Permanent generation capacity (KB).

PC

Current Permanent space capacity (KB).

YGC

Number of Young generation GC Events.

FGC

Number of Full GC Events.

2jstat –util 输出结果

Column

Description

S0

Survivor space 0 utilization as a percentage of the space's current capacity.

S1

Survivor space 1 utilization as a percentage of the space's current capacity.

E

Eden space utilization as a percentage of the space's current capacity.

O

Old space utilization as a percentage of the space's current capacity.

P

Permanent space utilization as a percentage of the space's current capacity.

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.

3jstat –gccause

Column

Description

LGCC

Cause of last Garbage Collection.

GCC

Cause of current Garbage Collection.

 

4jstat –gc

Column

Description

S0C

Current survivor space 0 capacity (KB).

S1C

Current survivor space 1 capacity (KB).

S0U

Survivor space 0 utilization (KB).

S1U

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.

 

 

 


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值