RFR (S): 8010916: Add tenuring threshold to young garbage collection events
Jesper Wilhelmsson
jesper.wilhelmsson at oracle.com
Tue Apr 2 10:33:02 UTC 2013
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.
/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