Monday, July 28, 2014

How to get garbage collection statistics

Get the ProcessID using jps command
Then execute the jstat command with the following option
-gccause
-h10  : number of lines
-<PID> : processID
-2000 : time interval


D:\>jstat -gccause -h10 3176 2000
  S0     S1     E      O      P     YGC     YGCT    FGC    FGCT     GCT    LGCC                 GCC
 27.88   0.00  32.55  24.67  47.10     16    1.074     0    0.000    1.074 unknown GCCause      No GC
 27.88   0.00  32.56  24.67  47.10     16    1.074     0    0.000    1.074 unknown GCCause      No GC
 27.88   0.00  32.56  24.67  47.10     16    1.074     0    0.000    1.074 unknown GCCause      No GC
 27.88   0.00  32.56  24.67  47.10     16    1.074     0    0.000    1.074 unknown GCCause      No GC
 27.88   0.00  32.56  24.67  47.10     16    1.074     0    0.000    1.074 unknown GCCause      No GC
 27.88   0.00  32.56  24.67  47.10     16    1.074     0    0.000    1.074 unknown GCCause      No GC
 27.88   0.00  32.56  24.67  47.10     16    1.074     0    0.000    1.074 unknown GCCause      No GC
 27.88   0.00  32.56  24.67  47.10     16    1.074     0    0.000    1.074 unknown GCCause      No GC


Where S0 and S1 are survivor spaces
 E is Eden space
 O Old Generation Size
 P Permanent generation
YGC Young Garbage Collection
YGCT Time taken for Young Garbage Collection
FGC FullGarbage Collection
FGCT Time taken for  FullGarbage Collection
GCT Total Garbage Collection Time

No comments:

Post a Comment