-
CSR
-
Resolution: Approved
-
P3
-
None
-
behavioral
-
low
-
This change should only affect existing users of minimal VM, which explicitly specifies a GC other than SerialGC on the command line. All other GCs have historically always been included in non-minimal VMs.
-
add/remove/modify command line option
-
Implementation
Summary
To avoid unexpected behavior, fail immediately if an unavailable GC is selected by the user on the command line.
Problem
If an unavailable GC (e.g. the G1 GC is not present in "minimal" VM builds) is selected by the user on the command line, then the VM issues a warning and continues execution by silently selecting a different/available GC. It's easy to miss the warning and this behavior is bound to cause unnecessary confusion. I propose that we instead fail immediately with an appropriate error message.
This has not been a very big problem so far (essentially only affecting minimal VMs). However, we've recently made it possible to configure which GCs to included/exclude in a VM (using the --with-jvm-features=cmsgc/epsilongc/g1gc/parallelgc/serialgc/zgc
option). Some of these GCs are also "experimental" and some vendors might choose to build them and some might choose not to. As a result, it might become more common to see VMs with different sets of supported GCs built in.
Solution
Instead of silently selecting one of the available GCs, fail immediately with an appropriate error message. E.g. "Option -XX:+UseG1GC not supported".
Specification
I'm essentially suggesting changing a call to:
warning("....");
to instead be a call to:
vm_exit_during_initialization(".....");
.
Webrev: http://cr.openjdk.java.net/~pliden/8205064/webrev.1/
- csr of
-
JDK-8205064 Fail immediately if an unavailable GC is selected
-
- Resolved
-