Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jstat for G1 Garbage Collector

Tags:

java

jvm

g1gc

I am trying to analyze memory usage pattern of Java Process with G1 Garbage Collector using jstat:

jstat -gc <Process_ID> 60s

The output looks like following:

 S0C    S1C    S0U    S1U      EC       EU        OC         OU       MC     MU    CCSC   CCSU   YGC     YGCT    FGC    FGCT     GCT   
 0.0   229376.0  0.0   229376.0 1998848.0 1253376.0 16646144.0  301183.5  50176.0 40977.8 8704.0 5303.9     10    0.296   0      0.000    0.296

As understood, jstat provides information about Young Generation GC as well as Full GC. But it doesn't distinguish between Minor and Mixed collections. Considering that in an well tuned G1 collector, Full GC is not expected and mostly Mixed GC takes care of Tenured generations, I want to get information about different types YGC.

Is there any specific option for jstat which I should use?

I have noticed this discussion on Open JDK forum, but not sure if such feature is available at this point of time.

Please note, I am aware of the fact that GC logs can help me here, but I am specifically interested about jstat (considering it's light weight and can be used in production as per the need basis).

like image 744
Arnab Biswas Avatar asked Oct 24 '25 21:10

Arnab Biswas


1 Answers

You can see this blog https://blogs.oracle.com/poonam/entry/understanding_g1_gc_logs , which has more detailed information about understanding the G1GC logs

like image 111
Fairoz Avatar answered Oct 27 '25 10:10

Fairoz



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!