JDK-8042250 : Misleading command line output for ReservedCodeCacheSize validation
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 7u45
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: linux_redhat_6.0
  • CPU: x86
  • Submitted: 2014-03-11
  • Updated: 2017-08-14
  • Resolved: 2014-05-07
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 7
7u76Fixed
Description
A DESCRIPTION OF THE PROBLEM :
$ cat Main.java
public class Main{
	public static void main(String ar[]){
		System.out.println("Hello world");
	}
}


$ java -version
java version "1.7.0_45"
Java(TM) SE Runtime Environment (build 1.7.0_45-b18)
Java HotSpot(TM) 64-Bit Server VM (build 24.45-b08, mixed mode)


$ javac Main.java

$ java -XX:ReservedCodeCacheSize=2495K Main
Invalid maximum code cache size: -XX:ReservedCodeCacheSize=2495K. Should be greater than InitialCodeCacheSize=2496K
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.




$ java -XX:ReservedCodeCacheSize=2496K Main
Hello world




EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
error message should say greater than or equal to InitialCodeCacheSize=2496K
ACTUAL -
Should be greater than InitialCodeCacheSize=2496K

URL OF FAULTY DOCUMENTATION :
it is code doc


Comments
Fixed in 8u20 and 9 by https://bugs.openjdk.java.net/browse/JDK-8014972.
02-05-2014

You are right, my mistake. 8013496 did not change this wording. But we need to fix it in all releases anyway.
30-04-2014

Note that JDK-8013496 is not responsible for this issue. Similar wording appears to be in code prior to that fix also (bug was logged using 7u45 as example)
30-04-2014

The message should be fixed in all releases where 8013496 was pushed.
30-04-2014

The format of the message changed with this changeset for JDK8 and later : http://hg.openjdk.java.net/hsx/hsx25/hotspot/rev/c07dd9be16e8 Submitter might have a point in that CodeCacheSize warning is off by 1K
30-04-2014