JDK-8029527 : GC specific flag verification happens before we decide which GC to use
  • Type: Bug
  • Component: hotspot
  • Sub-Component: gc
  • Affected Version: hs25
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • Submitted: 2013-12-04
  • Updated: 2016-08-22
  • Resolved: 2016-08-22
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 9
9Resolved
Related Reports
Duplicate :  
Description
In Arguments::check_vm_args_consistency() there is code that verifies the values of different flags. Some GC specific flags are only checked if the relevant GC is enabled. However, it's not until later that we decide on which GC to use.

If no GC is set on the command line we will start with UseParallelGC=false, we then skip verification of a bunch of flags. Later we decide that we run on a server class machine and set UseParallelGC=true.

For instance we can start with YoungGenerationSizeIncrement=100000 which will mess with adaptive size policy that expects this to be a percentage (0-100).

There are also flags, for instance ParGCCardsPerStrideChunk that are only checked if we run ParallelGC but are then used by CMS. Setting ParGCCardsPerStrideChunk=0 with CMS will crash the JVM.

Comments
I had a discussion with Jesper, the reporter of this problem. He agreed to close this CR after trying all his reproducers for this.
22-08-2016

As [~drwhite] commented, all gc flags' verification is addressed by JDK-8078555 (and its friends). All flags can be verified by hotspot/test/runtime/CommandLine/OptionsValidation/TestOptionsWithRanges.java. For those specific examples are no more issues now. 1. java -XX:YoungGenerationSizeIncrement=100000 -version uintx YoungGenerationSizeIncrement=100000 is outside the allowed range [ 0 ... 100 ] Improperly specified VM option 'YoungGenerationSizeIncrement=100000' Error: Could not create the Java Virtual Machine. Error: A fatal exception has occurred. Program will exit. 2. java -XX:ParGCCardsPerStrideChunk=0 -XX:+UseConcMarkSweepGC -Xmx64m GCOld 20 200 10 100 5000 intx ParGCCardsPerStrideChunk=0 is outside the allowed range [ 1 ... 9223372036854775807 ] Improperly specified VM option 'ParGCCardsPerStrideChunk=0' Error: Could not create the Java Virtual Machine. Error: A fatal exception has occurred. Program will exit. [~jwilhelm] do you have any other flags to verify? If not, I think this can be closed. Maybe as duplicate of JDK-8078555? It is the main CR of gc flag verification.
13-07-2016

This has been partially or fully remedied by fix for JDK-8078555 "GC: implement ranges (optionally constraints) for those flags that have them missing". Should re-evaluate to see if specific examples are fixed.
16-05-2016