From 5052a7eee57e9d145950a0ab1ca71edc02bfe0be Mon Sep 17 00:00:00 2001 From: Rui Li Date: Tue, 2 Sep 2025 23:49:23 +0000 Subject: [PATCH] 8246037: Shenandoah: update man pages to mention -XX:+UseShenandoahGC Reviewed-by: ysr, wkemper, cslucas --- .../gc/shenandoah/shenandoah_globals.hpp | 6 ++- src/java.base/share/man/java.md | 40 +++++++++++++++++++ 2 files changed, 44 insertions(+), 2 deletions(-) diff --git a/src/hotspot/share/gc/shenandoah/shenandoah_globals.hpp b/src/hotspot/share/gc/shenandoah/shenandoah_globals.hpp index c51f4f16489..026f352701d 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoah_globals.hpp +++ b/src/hotspot/share/gc/shenandoah/shenandoah_globals.hpp @@ -141,10 +141,12 @@ "GC heuristics to use. This fine-tunes the GC mode selected, " \ "by choosing when to start the GC, how much to process on each " \ "cycle, and what other features to automatically enable. " \ - "Possible values are:" \ + "When -XX:ShenandoahGCMode is generational, the only supported " \ + "option is the default, adaptive. Possible values are:" \ " adaptive - adapt to maintain the given amount of free heap " \ "at all times, even during the GC cycle;" \ - " static - trigger GC when free heap falls below the threshold;" \ + " static - trigger GC when free heap falls below a specified " \ + "threshold;" \ " aggressive - run GC continuously, try to evacuate everything;" \ " compact - run GC more frequently and with deeper targets to " \ "free up more memory.") \ diff --git a/src/java.base/share/man/java.md b/src/java.base/share/man/java.md index 9a750f8cf1f..1a6a944594f 100644 --- a/src/java.base/share/man/java.md +++ b/src/java.base/share/man/java.md @@ -2882,6 +2882,46 @@ Java HotSpot VM. expensive operations. Using a lower value will cause heap memory to be uncommitted earlier, at the risk of soon having to commit it again. +`-XX:+UseShenandoahGC` +: Enables the use of the Shenandoah garbage collector. This is a low pause + time, concurrent garbage collector. Its pause times are not proportional to + the size of the heap. Shenandoah garbage collector can work with compressed + pointers. See `-XX:UseCompressedOops` for further information about + compressed pointers. + +`-XX:ShenandoahGCMode=`*mode* +: Sets the GC mode for Shenandoah GC to use. By default, this option is set + to `satb`. Among other things, this defines which barriers are in use. + Possible mode values include the following: + + `satb` + : Snapshot-at-the-beginning concurrent GC (three pass mark-evac-update). + It is a single generation GC. + + `generational` + : It is also a snapshot-at-the-beginning and concurrent GC, but it is + generational. Please see [JEP 404](https://openjdk.org/jeps/404) and + [JEP 521](https://openjdk.org/jeps/521) for its advantages and risks. + +`-XX:ShenandoahGCHeuristics=`*heuristics* +: Sets the heuristics for Shenandoah GC to use. By default, this option is + set to `adaptive`. This fine-tunes the GC mode selected, by choosing when + to start the GC, how much to process on each cycle, and what other features + to automatically enable. When `-XX:ShenandoahGCMode` is `generational`, the + only supported option is the default, `adaptive`. + + Possible heuristics are the following: + + `adaptive` + : To maintain the given amount of free heap at all times, even during + the GC cycle. + + `static` + : Trigger GC when free heap falls below a specified threshold. + + `compact` + : Run GC more frequently and with deeper targets to free up more memory. + ## Deprecated Java Options These `java` options are deprecated and might be removed in a future JDK