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?
java garbage-collection g1gc
Cameron balahan
source share