Can JMC handle multiple YoungGarbageCollectionEvents with the same value for the gcId field?
Peter Booth
peter_booth at me.com
Sun Jan 15 12:09:53 UTC 2023
How does this compare to the existing behavior of pre-existing collectors?
Does it mean that IDEs, debuggers, profilers, monitoring tools might break when used with ZGC?
For the scenario where there two minor GCs does this we have two events that aren’t equal yet can’t be distinguished or “looked up?” Are these event objects conceptually immutable value objects or are they owned by the first GC event object?
I guess I’m trying to diplomatically ask “is this a bad smell?”
Peter
Sent from my iPhone
> On Jan 13, 2023, at 5:43 PM, Erik Duveblad <erik.helin at oracle.com> wrote:
>
> Hey all,
>
> I’m looking at the JFR events that will be sent for generational ZGC [0].
>
> With generational ZGC there are broadly speaking two kinds of garbage collections (“minor” and “major”) and each garbage collection can collect one or more generations, zero or more times. More concretely, a minor garbage collection will collect the young generation once and a major garbage collection will collect the young generation _one or two times_ and the old generation once.
>
> The JFR events I plan for generational ZGC to send are:
>
> - a “jdk.GarbageCollection” event when a “minor” or “major” garbage collection occurs
> - a “jdk.YoungGarbageCollection” event when the young generation is collected
> - a “jdk.OldGarbageCollection” event when the old generation is collected
>
> Combining the above means that there is a new situation: when a major garbage collection occurs that collects the young generation *two* times and the old generation once, then the following events will be sent:
>
> - one “jdk.GarbageCollection” event with a given gcId “n"
> - two “jdk.YoungGarbageCollection” events with the gcId field set to “n”
> - one “jdk.OldGarbageCollection” event with the gcId field to to “n”
>
> This would be the first time a HotSpot garbage collector sends multiple (two in this case) “jdk.YoungGarbageCollection” events with the same value for the gcId field. So I wanted to check with you all if JMC makes any assumptions or relies upon the fact that up until now all “jdk.YoungGarbageCollection” events have a unique value for the “gcId” field?
>
> Thanks,
> Erik
>
>
> [0]: https://openjdk.org/jeps/8272979
More information about the jmc-dev
mailing list