JDK-8068942 : Improve validation of -XX:G1ConfidencePercent value
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: gc
  • Affected Version: 9
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2015-01-13
  • Updated: 2017-05-17
  • Resolved: 2015-01-29
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
9 b51Fixed
Related Reports
Relates :  
Relates :  
Relates :  
Description
The -XX:G1ConfidencePercent option is expected to be an integer percentage.  However, there is no code in argument processing to verify that it is a valid percentage.

Instead, dealing with invalid values (e.g. > 100) is presently left to the one user of this option, the constructor for G1CollectorPolicy.  There, if an invalid value is detected, the value is clipped to 100 and a warning message is printed (if PrintWarnings option is true).

It would be better to detect the invalid option value during option processing and deal with it there in the normal fashion, rather than leaving it to users of the option to worry about bad values and deal with such in an ad hoc manner.  Specifically, the function Arguments::check_vm_args_consistency() should use verify_percentage() to check this option's value.

Comments
The current clip and warn behavior was introduced in http://hg.openjdk.java.net/hsx/hsx25/hotspot/rev/f1fb03a251e9, circa 2/21/2013. That behavior is present as far back as jdk7u40. The previous behavior was that bad values for this option led to a guarantee failure. See https://bugs.openjdk.java.net/browse/JDK-8008546.
13-01-2015