JDK-8342640 : GenShen: Silently ignoring ShenandoahGCHeuristics considered poor user-experience
  • Type: Sub-task
  • Component: hotspot
  • Sub-Component: gc
  • Priority: P4
  • Status: Open
  • Resolution: Unresolved
  • Submitted: 2024-10-18
  • Updated: 2024-10-21
Related Reports
Relates :  
Description
GenShen silently ignores junk in ShenandoahGCHeuristics. We might want to revise that. I want to see what the historical behavior was, and whether current behavior can be made more user-friendly.

```
% ./build/linux-x86_64-server-release/images/jdk/bin/java -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -XX:ShenandoahGCMode=generational -XX:+PrintFlagsFinal -version  | grep -i heuristics
    ccstr ShenandoahGCHeuristics                   = adaptive                                  {product} {default}
openjdk version "24-internal" 2025-03-18
OpenJDK Runtime Environment (build 24-internal-adhoc.ysr.shenandoah)
OpenJDK 64-Bit Server VM (build 24-internal-adhoc.ysr.shenandoah, mixed mode, sharing)

% ./build/linux-x86_64-server-release/images/jdk/bin/java -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -XX:ShenandoahGCMode=generational -XX:ShenandoahGCHeuristics=junk -XX:+PrintFlagsFinal -version  | grep -i heuristics                                                                                   
    ccstr ShenandoahGCHeuristics                   = junk                                      {product} {command line}
openjdk version "24-internal" 2025-03-18
OpenJDK Runtime Environment (build 24-internal-adhoc.ysr.shenandoah)
OpenJDK 64-Bit Server VM (build 24-internal-adhoc.ysr.shenandoah, mixed mode, sharing)

% ./build/linux-x86_64-server-release/images/jdk/bin/java -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=junk -XX:+PrintFlagsFinal -version  | grep -i heuristics 
Unknown -XX:ShenandoahGCHeuristics option

% ./build/linux-x86_64-server-release/images/jdk/bin/java -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=junk -XX:+PrintFlagsFinal -version                     
Error occurred during initialization of VM
Unknown -XX:ShenandoahGCHeuristics option
```
Comments
In keeping with current Shenandoah behaviour, and general HotSpot options philosophy, we'll return an error if the user attempts to set up a heuristics option incompatible with GenShen.
21-10-2024