Skip to content

Add JMX metrics mappings for Generational Shenandoah#596

Open
krrg wants to merge 1 commit intoDataDog:masterfrom
krrg:add-genshen-jmx-metrics-mappings-12-mar-2026
Open

Add JMX metrics mappings for Generational Shenandoah#596
krrg wants to merge 1 commit intoDataDog:masterfrom
krrg:add-genshen-jmx-metrics-mappings-12-mar-2026

Conversation

@krrg
Copy link
Copy Markdown

@krrg krrg commented Mar 13, 2026

GenShen was released with OpenJDK 24 and creates memory pools with the names Shenandoah Young Gen and Shenandoah Old Gen (see https://github.com/openjdk/jdk/blame/master/src/hotspot/share/gc/shenandoah/shenandoahMemoryPool.cpp#L102)

This adds mappings for those metrics so they can eventually be pulled all the way into DataDog.

@krrg krrg requested a review from a team as a code owner March 13, 2026 18:00
@carlosroman
Copy link
Copy Markdown
Contributor

So these metrics will be generated by default on JDK21 or do I need to enable a particular GC?

@krrg
Copy link
Copy Markdown
Author

krrg commented Mar 24, 2026

These metrics will only be generated with the Generational Shenandoah GC enabled.

For JDK 21, GenShen was gated behind an experimental flag, so you'd need something like

-XX:+UseShenandoahGC -XX:+UnlockExperimentalVMOptions -XX:ShenandoahGCMode=generational

For JDK 24+, GenShen is the default variant of Shenandoah, so you'd just need

-XX:+UseShenandoahGC

The metrics won't get mapped if the MBean doesn't exist (and it is created by enabling a specific GC, in this case Shenandoah). So if you do not have ShenandoahGC enabled, then the mapping would just be ignored, just like any of the other GC mappings for G1, ZGC, etc, if they are not in use, since the MBeans would be missing.

A similar change was made for Generational mode ZGC in #566.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants