RFR: Exit gracefully when Shenandoah is not supported

Aleksey Shipilev shade at redhat.com
Tue Mar 21 11:01:28 UTC 2017

This affects only 9. It will crash like this:

$ build/linux-x86-normal-server-release/images/jdk/bin/java -XX:+UseShenandoahGC
OpenJDK Server VM warning: -XX:+UseShenandoahGC not supported in this VM
# A fatal error has been detected by the Java Runtime Environment:
#  Internal Error (universe.cpp:745), pid=18763, tid=18764
#  Error: ShouldNotReachHere()

The trouble is that JDK 9 code is missing UNSUPPORTED_GC_OPTION macro, which
used to default to Serial GC in cases like this. Let's just exit gracefully:

diff -r a7f9abea2a6d src/share/vm/runtime/arguments.cpp
--- a/src/share/vm/runtime/arguments.cpp	Tue Mar 21 11:32:00 2017 +0100
+++ b/src/share/vm/runtime/arguments.cpp	Tue Mar 21 12:00:55 2017 +0100
@@ -2053,7 +2053,7 @@
 void Arguments::set_shenandoah_gc_flags() {

 #if !(defined AARCH64 || defined AMD64)
+  vm_exit_during_initialization("Shenandoah GC is not supported on this

 #ifdef _LP64

$ build/linux-x86-normal-server-release/images/jdk/bin/java -XX:+UseShenandoahGC
Error occurred during initialization of VM
Shenandoah GC is not supported on this platform.


More information about the shenandoah-dev mailing list