RFR (S): 8010916: Add tenuring threshold to young garbage collection events

Jesper Wilhelmsson jesper.wilhelmsson at oracle.com
Wed Apr 3 17:57:23 UTC 2013


Looks good,
Ship it!
/Jesper

Erik Helin skrev 3/4/13 7:19 PM:
> Hi Jesper,
>
> thanks for the review! I would also like to thank Stefan for taking a look at
> the code offline.
>
> On 04/02/2013 12:33 PM, Jesper Wilhelmsson wrote:
>> Erik,
>>
>> I'm OK with this change as is but I think it is unfortunate that you
>> chose not to follow the pattern used by the other events where we
>> register a value at some point and then, in the end, report the event. I
>> realize that in this case it would probably result in registering the
>> tenuring threshold and then at the next line reporting the YC event. I'm
>> not sure which is worse. I don't really like that you need to pass the
>> tenuring threshold to report_young_gc_end.
>
> The change has been updated to now saving the value in the young gc tracer and
> then report it at the end. I would prefer to not have to deal with this extra
> state, but it has to be this way because the young gc event needs the GC end
> time, and the end time is only passed to report_gc_end (thanks Stefan for
> pointing this out).
>
> Please see new webrev at:
> http://cr.openjdk.java.net/~ehelin/8010916/webrev.01/
>
> Thanks,
> Erik
>
>> /Jesper
>>
>>
>> Erik Helin skrev 1/4/13 11:04 AM:
>>> Hi all,
>>>
>>> this change adds the field "tenuringThreshold" to the
>>> "vm/gc/collector/young_garbage_collection" event.
>>>
>>> The code in gcTrace.hpp/cpp have been slightly adjusted to support this.
>>> The hierarchy of tracers is:
>>>
>>>      G1NewTracer -> YoungGCTracer -> GCTracer
>>>
>>> where "->" means "inherits from".
>>>
>>> Previously, the method "report_gc_end_impl" was virtual in "GCTracer"
>>> to enable
>>> "YoungGCTracer" to send the young GC event when "report_gc_end" was
>>> called on a
>>> GCTracer, as in the following:
>>>
>>>      void GCTracer::report_gc_end(...) {
>>>        // do other stuff
>>>        report_gc_end_impl(...);
>>>      }
>>>
>>>      void YoungGCTracer::report_gc_end_impl(...) {
>>>        // send young gc event here
>>>      }
>>>
>>> In this change, YoungGCTracer now has a method "report_young_gc_end"
>>> that is
>>> virtual and that G1NewTracer overrides. This means that YoungGCTracer
>>> does not
>>> need to override the method "report_gc_end_impl" from GCTracer. This
>>> also means
>>> that all young collectors now also must call "report_young_gc_end".
>>>
>>> This change was needed, since report_young_gc_end must take the tenuring
>>> threshold as a parameter, something that was not possible to do with
>>> "report_gc_end_impl".
>>>
>>> Webrev:
>>> http://cr.openjdk.java.net/~ehelin/8010916/webrev.00/
>>>
>>> Bug:
>>> http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=8010916
>>>
>>> Testing:
>>> JPRT
>>>
>>> Thanks,
>>> Erik
>



More information about the hotspot-gc-dev mailing list