Skip to Main Content

Java HotSpot Virtual Machine

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interprets the output of -XX:+PrintGCDetails

843829Jun 6 2008 — edited Jun 6 2008
hi,

I copied below description from this link: http://java.sun.com/docs/hotspot/gc1.4.2/example.html. Can someone explain me how did they calculate 40% objects in the young generation were garbage?

The young generation heap size in this first example is about 4 Mbytes with an overall heap size of about 32 Mbytes.

+[GC [DefNew: 4032K->64K(4032K), 0.0429742 secs] 9350K->7748K(32704K), 0.0431096 secs]+

This output seems reasonable from the point of view of the time spent in garbage collection but note that although the occupancy of the young generation is decreasing (e.g., in the first line from 4032 to 64k by 3968k) the occupancy of the entire heap is decreasing by considerably less (by 1602k from 9350k to 7748k). This indicates that only about *40%* objects in the young generation were garbage and the rest survive the collection and are being promoted into the old generation.

Thanks in advance
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 4 2008
Added on Jun 6 2008
4 comments
357 views