RFR: 8342640: GenShen: Silently ignoring ShenandoahGCHeuristics considered poor user-experience [v2]
Rui Li
duke at openjdk.org
Wed Aug 27 22:47:58 UTC 2025
> When generational shenandoah is enabled, it ignores the value of ShenandoahGCHeuristics input silently:
>
> java -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -XX:ShenandoahGCMode=generational -XX:ShenandoahGCHeuristics=junk -version
> openjdk version "25" 2025-09-16 LTS
> OpenJDK Runtime Environment Corretto-25.0.0.36.1 (build 25+36-LTS)
> OpenJDK 64-Bit Server VM Corretto-25.0.0.36.1 (build 25+36-LTS, mixed mode, sharing)
>
>
> Adding additional guard rail to gen shen is not an option - it is actually by design that gen shen does not support non adaptive heuristics due to the complexity brought by generational design.
>
> So print out a warning to users to indicate that their `ShenandoahGCHeuristics` input is ignored.
>
>
> x64 (8342640) % java -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -XX:ShenandoahGCMode=generational -XX:ShenandoahGCHeuristics=static -version
> [0.001s][warning][gc] Ignoring -XX:ShenandoahGCHeuristics input: static, because generational shenandoah only supports adaptive heuristics
> openjdk version "26" 2026-03-17
> OpenJDK Runtime Environment Corretto-26.0.2.1.1 (slowdebug build 26+2-FR)
> OpenJDK 64-Bit Server VM Corretto-26.0.2.1.1 (slowdebug build 26+2-FR, mixed mode)
>
> x64 (8342640) % java -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -XX:ShenandoahGCMode=generational -XX:ShenandoahGCHeuristics=junk -version
> [0.001s][warning][gc] Ignoring -XX:ShenandoahGCHeuristics input: junk, because generational shenandoah only supports adaptive heuristics
> openjdk version "26" 2026-03-17
> OpenJDK Runtime Environment Corretto-26.0.2.1.1 (slowdebug build 26+2-FR)
> OpenJDK 64-Bit Server VM Corretto-26.0.2.1.1 (slowdebug build 26+2-FR, mixed mode)
>
> x64 (8342640) % java -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -XX:ShenandoahGCMode=generational -XX:ShenandoahGCHeuristics=adaptive -version
> openjdk version "26" 2026-03-17
> OpenJDK Runtime Environment Corretto-26.0.2.1.1 (slowdebug build 26+2-FR)
> OpenJDK 64-Bit Server VM Corretto-26.0.2.1.1 (slowdebug build 26+2-FR, mixed mode)
>
> x64 (8342640) % java -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -XX:ShenandoahGCMode=generational -version
> openjdk version "26" 2026-03-17
> OpenJDK Runtime Environment Corretto-26.0.2.1.1 (slowdebug build 26+2-FR)
> OpenJDK 64-Bit Server VM Corretto-26.0.2.1.1 (slowdebug build 26+2-FR, mixed mode)
Rui Li has updated the pull request incrementally with one additional commit since the last revision:
Update
-------------
Changes:
- all: https://git.openjdk.org/jdk/pull/26968/files
- new: https://git.openjdk.org/jdk/pull/26968/files/c999d47f..247dce42
Webrevs:
- full: https://webrevs.openjdk.org/?repo=jdk&pr=26968&range=01
- incr: https://webrevs.openjdk.org/?repo=jdk&pr=26968&range=00-01
Stats: 5 lines in 1 file changed: 3 ins; 0 del; 2 mod
Patch: https://git.openjdk.org/jdk/pull/26968.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/26968/head:pull/26968
PR: https://git.openjdk.org/jdk/pull/26968
More information about the hotspot-gc-dev
mailing list