Support generational ZGC and generational Shenandoah#26676
Support generational ZGC and generational Shenandoah#26676jjudd wants to merge 1 commit intobazelbuild:masterfrom
Conversation
Bazel currently does not start when you launch the server JVM with generational ZGC using -XX:+UseZGC and -XX:+ZGenerational. Or if you're on JDK 24+ the same problem is encountered with just -XX:+UseZGC. The same problem is encountered with -XX:+UseShenandoahGC and -XX:ShenandoahGCMode=generational. Non-generational ZGC is removed as of JDK 24. Generational Shenandoah is being promoted from experimental to production in JDK 25. This fix is modeled after bazelbuild#12644
|
FWIW, I tested this by building Bazel with this change, then used it to build some non-trivial Scala targets in our main monorepo on JDK 24 using generational ZGC and then again with generational Shenandoah. Bazel failed to start with either GC before this change. After this change both built successfully. |
fmeum
left a comment
There was a problem hiding this comment.
Just curious, did you see better overall performance with one of these GCs?
|
Good question and one I intend to answer, but haven't yet. I went to play around with Generational ZGC to see if it had any noticeable impact on builds and ran into this issue. I know it's not Bazel, but our production application has been using generational ZGC for a while now. It does a great job of decreasing tail latency and overall we're quite happy with it. That said, we did run into some native memory challenges at the start. In particular we noticed https://bugs.openjdk.org/browse/JDK-8339161 which is fixed in JDK 24. We were able to mitigate some of the native memory pressure using |
|
@bazel-io fork 8.4.0 |
Bazel currently does not start when you launch the server JVM with generational ZGC using `-XX:+UseZGC` and `-XX:+ZGenerational`. Or if you're on JDK 24+ the same problem is encountered with just `-XX:+UseZGC`. The same problem is encountered with `-XX:+UseShenandoahGC` and `-XX:ShenandoahGCMode=generational`. Non-generational ZGC is removed as of JDK 24. Generational Shenandoah is being promoted from experimental to production in JDK 25. This fix is modeled after bazelbuild#12644 Closes bazelbuild#26676. PiperOrigin-RevId: 789746919 Change-Id: Ia070fa9b39cef07cc9987544c014d589b2504dce
Bazel currently does not start when you launch the server JVM with generational ZGC using `-XX:+UseZGC` and `-XX:+ZGenerational`. Or if you're on JDK 24+ the same problem is encountered with just `-XX:+UseZGC`. The same problem is encountered with `-XX:+UseShenandoahGC` and `-XX:ShenandoahGCMode=generational`. Non-generational ZGC is removed as of JDK 24. Generational Shenandoah is being promoted from experimental to production in JDK 25. This fix is modeled after #12644 Closes #26676. PiperOrigin-RevId: 789746919 Change-Id: Ia070fa9b39cef07cc9987544c014d589b2504dce Commit 3a1fe64 Co-authored-by: James Judd <[email protected]>
JDK 21+ introduces generational ZGC ("ZGC Old Generation") and
generational Shenandoah ("Shenandoah Old Gen"). Bazel's
isTenuredSpace() only knew the older pool names ("ZHeap",
"Shenandoah"), causing MemoryPressureModule to crash on startup
when using these collectors.
This is a backport of the upstream fix:
- Issue: bazelbuild#26676
- PR: bazelbuild#26684
- Commit: bazelbuild@3a1fe64
Co-authored-by: Cursor <[email protected]>
Bazel currently does not start when you launch the server JVM with generational ZGC using
-XX:+UseZGCand-XX:+ZGenerational. Or if you're on JDK 24+ the same problem is encountered with just-XX:+UseZGC.The same problem is encountered with
-XX:+UseShenandoahGCand-XX:ShenandoahGCMode=generational.Non-generational ZGC is removed as of JDK 24. Generational Shenandoah is being promoted from experimental to production in JDK 25.
This fix is modeled after #12644