JVM性能調優3:JVM_堆溢出分析過程和命令 -开发者知识库

JVM性能調優3:JVM_堆溢出分析過程和命令 -开发者知识库,第1张

 本系列包括: JVM性能調優1:JVM性能調優理論及實踐(收集整理)JVM性能調優2:JVM性能調優參數整理JVM性能調優3:JVM_堆溢出分析過程和命令 JVm性能調優4:GC日志分析 JVM性能調優5:Heap堆分析方法





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.

 

 

 



最佳答案:

本文经用户投稿或网站收集转载,如有侵权请联系本站。

发表评论

0条回复