RFR: 8342640: GenShen: Silently ignoring ShenandoahGCHeuristics considered poor user-experience [v2]
Y. Srinivas Ramakrishna
ysr at openjdk.org
Wed Aug 27 23:07:41 UTC 2025
On Wed, 27 Aug 2025 22:47:58 GMT, Rui Li <duke at openjdk.org> wrote:
>> 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
Thanks for fixing this. The new behaviour is much more user friendly, and I like the clear error message.
Approved, modulo testing results (which I don't expect any issues with given the change).
-------------
Marked as reviewed by ysr (Reviewer).
PR Review: https://git.openjdk.org/jdk/pull/26968#pullrequestreview-3162061524
More information about the hotspot-gc-dev
mailing list