Java VM does not recognize -XX: G1YoungGenSize?

I use the G1 garbage collector with JDK1.7.0, but the VM does not recognize the G1YoungGenSize variant. In particular, when I run:

java -XX:+UnlockExperimentalVMOptions -XX:+UseG1GC -XX:G1YoungGenSize=512m ... 

I get the following error:

 Unrecognized VM option 'G1YoungGenSize=512m' Error: Could not create the Java Virtual Machine. Error: A fatal exception has occurred. Program will exit. 

I also tried it with the “+” sign in front of G1YoungGenSize, as some of the G1 documentation lists it like this:

 java -XX:+UnlockExperimentalVMOptions -XX:+UseG1GC -XX:+G1YoungGenSize=512m ... 

But I get the same error.

I tried the older JDKs, including 1.6 update from 18 to 21. It seems that G1YoungGenSize is recognized through update 20 and breaks from 21 to the latest version 1.7 (snapshot from August 19, 2010).

Does anyone know what might cause this error?

+6
java garbage-collection g1gc
source share
1 answer

This is similar to a change about 6 months ago:

6928065: G1: use existing command line options to set the size of the younger generation http://hg.openjdk.java.net/jdk7/jdk7/hotspot/rev/a1c410de27e4

Changes are made for 1.6 here:

http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6928065

To fit with other GCs, G1 must observe UseAdaptiveSizePolicy to decide whether it is necessary to auto-size the younger generation. NewSize / MaxNewSize (as well as -Xmn) should determine the initial maximum size.

+6
source share

All Articles