Registering new ZGC classes #429
-
Starting to look at the ZGC update in GCToolkit 3.5.0 and have a question: Is there a specific reason that the new ZGC classes (Full/Major/MinorZGCCycle) don't inherit from a common "ZGC" root class like the other collectors? Ultimately it means I have to register a method for each event type specifically which isn't a big deal. It just seems that it's a slight deviation from the way the other Event classes are defined. Also, the hierarchy chart in DEVELOPERS_GUIDE should be updated to account for the new ZGC classes. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
@j-bahr contributed the changes and can answer the question authoritatively. There could be a ZGCEvent that hoists the ZGCMemorySummary and GC id. |
Beta Was this translation helpful? Give feedback.
-
The ZGC collector supports legacy ZGC and Generational ZGC. Legacy is going away in newer versions of Java but I made an effort to leave support for it here. The structure of the events between versions are largely the same except that generational now has multiple phases, young only, young and old. The cycle data is largely the same between legacy (full gc) and the phases young and old. To accommodate this with the least amount of effort we have the structure shown below,
If you're interested in registering for a single event type you'll need to check Register for single event, but must use
Registering for all events:
|
Beta Was this translation helpful? Give feedback.
-
Thanks @kcpeppe @j-bahr for your responses. I've got no issues with the model @j-bahr has built, I just wanted to make sure it was intentional and not overlooked. Generational and G1 have "collector type" events (GenerationalGCEvent and G1GCEvent respectively) but the ZGC events extended from GCEvent. In truth, given the difference in data potentially available with each event type, it does make sense to deal with them on a Major/Minor/Full basis instead of as a collective group. Thanks everyone! |
Beta Was this translation helpful? Give feedback.
@jlittle-ptc
The ZGC collector supports legacy ZGC and Generational ZGC. Legacy is going away in newer versions of Java but I made an effort to leave support for it here. The structure of the events between versions are largely the same except that generational now has multiple phases, young only, young and old. The cycle data is largely the same between legacy (full gc) and the phases young and old. To accommodate this with the least amount of effort we have the structure shown below,
FullZGCCycle
,MajorZGCCycle
andMinorZGCCycle
which all extend fromGCEvent
.ZGCCycle
is just an internal data class that holds the information from the cycle whether it's full, young or old generational data.