JFR Event for Full GCs
Andrew Azores
aazores at redhat.com
Fri Dec 7 14:11:28 UTC 2018
Hi,
On 2018-12-05 4:54 p.m., Thomas Schatzl wrote:
> Hi,
>
> On Wed, 2018-12-05 at 12:23 -0500, Andrew Azores wrote:
>> Hmm. It's along the right lines (and I had overlooked it before) but
>> I don't think this event meets the requirement. I modified my JMC
>> testing rule to look for those events while running my reproducer
>> applet with -XX:+UseG1GC -XX:+PrintGCDetails. My run saw one
>> OldGarbageCollection event emitted but the GC log output does not
>> show any Full GC events. I also tried reading through the JFR and GC
>> sources again to trace the execution path where this event is
>> emitted, and although I wasn't 100% confident, it didn't look to me
>> like this event is 1:1 with Full collections - perhaps a Full
>> collection implies this event emission but not vice-versa? From my
>> limited understanding of the GC phases and generations this would
>> seem to make sense.
>
> iirc a completed marking cycle also counts as "full" collection in
> some cases as it completely considers the old generation too.
> PrintGCDetails should show them.
>
> (Young collections may actually also reclaim space in old gen but does
> not send this event - so actually this OldGarbageCollection event may
> actually be considered as some kind of backwards compatibility hack for
> G1 in any case)
>
> Thanks,
> Thomas
>
>
Sorry, I'm not sure I've fully understood. Are you saying that the
OldGarbageCollection event really should signify that a full collection
has occurred? I don't think I saw any instances of a marking cycle
showing as a full collection in the logs, but maybe it was there and I
just didn't know what I was looking for.
The GarbageCollection event's gcName field seems that it may actually do
the trick for G1, since G1 has distinct gcNames for G1New/G1Old/*G1Full*
which are tagged on by the various GCTracers. Testing a JMC rule that
looks for those and comparing its results to PrintGCDetails looks like
it is working as expected, with one event seen for each "Pause Full" in
the logs. Should OldGarbageCollection be a CMS analog to these events?
--
Andrew Azores
Software Engineer, OpenJDK Team
Red Hat
More information about the hotspot-jfr-dev
mailing list