Java Reference
In-Depth Information
% jstat -gcutil process_id 1000
S0 S1 E O P YGC YGCT FGC FGCT GCT
51.71 0.00 99.12 60.00 99.93 98 1.985 8 2.397 4.382
0.00 42.08 5.55 60.98 99.93 99 2.016 8 2.397 4.413
0.00 42.08 6.32 60.98 99.93 99 2.016 8 2.397 4.413
0.00 42.08 68.06 60.98 99.93 99 2.016 8 2.397 4.413
0.00 42.08 82.27 60.98 99.93 99 2.016 8 2.397 4.413
0.00 42.08 96.67 60.98 99.93 99 2.016 8 2.397 4.413
0.00 42.08 99.30 60.98 99.93 99 2.016 8 2.397 4.413
44.54 0.00 1.38 60.98 99.93 100 2.042 8 2.397 4.439
44.54 0.00 1.91 60.98 99.93 100 2.042 8 2.397 4.439
When monitoring started, the program had already performed 98 collections of the young
generation ( YGC ), which took a total of 1.985 seconds ( YGCT ). It had also performed eight full
GCs ( FGC ) requiring 2.397 seconds ( FGCT ); hence the total time in GC ( GCT ) was 4.382
seconds.
All three sections of the young generation are displayed here: the two survivor spaces ( S0
and S1 ) and eden ( E ). The monitoring started just as eden was filling up (99.12% full), so in
the next second there was a young collection: eden reduced to 5.55% full, the survivor spaces
switched places, and a small amount of memory was promoted to the old generation ( O ),
which increased to using 60.98% of its space. As is typical, there is little or no change in the
permanent generation ( P ) since all necessary classes have already been loaded by the applica-
tion.
If you've forgotten to enable GC logging, this is a good substitute to watch how GC operates
over time.
QUICK SUMMARY
1. GC logs are the key piece of data required to diagnose GC issues; they should be
collected routinely (even on production servers).
2. A better GC logfile is obtained with the PrintGCDetails flag.
3. Programs to parse and understand GC logs are readily available; they are quite
helpful in summarizing the data in the GC log.
4. jstat can provide good visibility into GC for a live program.
Search WWH ::




Custom Search