Direct promotion to old gen
Y.S.Ramakrishna at Sun.COM
Y.S.Ramakrishna at Sun.COM
Mon Aug 3 10:49:36 PDT 2009
Hi Sujit --
On 08/ 3/09 10:18 AM, Sujit.Das at cognizant.com wrote:
> Hi All,
> I am trying to capture statistics to denote direct promotion from young
> gen to old gen.
> As per my understanding, minor collection will empty eden space and put
> surviving objects into 'To' survivor space. Objects that have survived
> more than Max Tenuring Threshold value will get promoted. Example: If
> max Tenuring Threshold is 4, then in age 4 size that gets printed in
> verbose GC output will be the size that should get promoted in old gen
> as part of next minor collection. Anything more than previous age4 size
> is result of direct promotion from eden space to old gen.
Your description is partially correct, in that you cannot have _more_
than the # in the previous age=4 cohort promoting into the old gen
unless survivor spaces overflowed for some reason. But you may have
fewer because some of them died before this GC. Thus, you cannot accurately
get the "direct promotion size" (i.e. those below tenuring threshold age
that got prematurely promoted to old gen) by
simply subtracting the previous age=4 cohort from the total promoted
size, for the simple reason that it is possible that only a small
subset of the previous age=4 cohort survive a fifth GC (in fact for
a well-tuned heap, you would expect that to be usually the case). Thus, more
often than not, total promoted - (age=4 cohort) in yr example will
be a negative number, in other words, there is a good chance you
will be underestimating or at least measuring somewhat incorrectly
what you were trying to measure. (I am wondering if heap profilers
which know about the generational nature of the heap might be able
to provide you with more accurate information on this, albeit at
higher cost. Perhaps someone on the list would know?)
PS: By the way, remember that there may also be direct allocation into
the old generation (for example of very large objects) between 2 scavenges,
so do not assume that the occupancy of the old generation before a scavenge
is the same as that after the preceding scavenge (if you know what i mean).
This is a mistake that people often make the first time they
are looking at our GC logs.
> Please confirm my understanding / approach. If above understanding is
> correct, I plan to get plot of
> (Promo from current minor collection - Age4 from previous minor collection)
> The values will help me to determine whether I need to tune my eden and
> survivor spaces.
> Your help much appreciated.
> This e-mail and any files transmitted with it are for the sole use of
> the intended recipient(s) and may contain confidential and privileged
> If you are not the intended recipient, please contact the sender by
> reply e-mail and destroy all copies of the original message.
> Any unauthorized review, use, disclosure, dissemination, forwarding,
> printing or copying of this email or any action taken in reliance on
> this e-mail is strictly prohibited and may be unlawful.
> hotspot-gc-use mailing list
> hotspot-gc-use at openjdk.java.net
hotspot-gc-use mailing list
hotspot-gc-use at openjdk.java.net
More information about the hotspot-gc-dev