A configuration anomaly wrt the NewSize parameter was observed
beginning with JRE 6 Update 4. As a result the JVM refuses to
start and issues confusing error message:
Error occurred during initialization of VM
Could not reserve enough space for object heap
The issue is strictly reproducible.
1. Testcase
-----------
% more Test.java
public class Test {
public static void main(String[] args) {
System.out.println("Hello");
}
}
Compile:
% /jdk1.6.0_03/bin/javac Test.java
%
2. Run on 6u4, 6u7, 6u12, 6u13
------------------------------
% /jdk1.6.0_04/bin/java -XX:NewSize=32m -Xms128m -Xmx128m Test
Error occurred during initialization of VM
Could not reserve enough space for object heap
%
% /jdk1.6.0_07/bin/java -XX:NewSize=32m -Xms128m -Xmx128m Test
Error occurred during initialization of VM
Could not reserve enough space for object heap
%
% /jdk1.6.0_12/bin/java -XX:NewSize=32m -Xms128m -Xmx128m Test
Error occurred during initialization of VM
Could not reserve enough space for object heap
%
% /jdk1.6.0_13/bin/java -XX:NewSize=32m -Xms128m -Xmx128m Test
Error occurred during initialization of VM
Could not reserve enough space for object heap
%
3. Compare: run on 6u3
----------------------
% /jdk1.6.0_03/bin/java -XX:NewSize=32m -Xms128m -Xmx128m Test
Hello
%
4. Increase NewSize value
-------------------------
% /jdk1.6.0_13/bin/java -XX:NewSize=39m -Xms128m -Xmx128m Test
Error occurred during initialization of VM
Could not reserve enough space for object heap
% /jdk1.6.0_13/bin/java -XX:NewSize=40m -Xms128m -Xmx128m Test
Hello
%
5. Add MaxNewSize parameter
---------------------------
% /jdk1.6.0_13/bin/java -XX:NewSize=32m -XX:MaxNewSize=64m -Xms128m -Xmx128m Test
Error occurred during initialization of VM
Could not reserve enough space for object heap
% /jdk1.6.0_13/bin/java -XX:NewSize=32m -XX:MaxNewSize=32m -Xms128m -Xmx128m Test
Hello
%
beginning with JRE 6 Update 4. As a result the JVM refuses to
start and issues confusing error message:
Error occurred during initialization of VM
Could not reserve enough space for object heap
The issue is strictly reproducible.
1. Testcase
-----------
% more Test.java
public class Test {
public static void main(String[] args) {
System.out.println("Hello");
}
}
Compile:
% /jdk1.6.0_03/bin/javac Test.java
%
2. Run on 6u4, 6u7, 6u12, 6u13
------------------------------
% /jdk1.6.0_04/bin/java -XX:NewSize=32m -Xms128m -Xmx128m Test
Error occurred during initialization of VM
Could not reserve enough space for object heap
%
% /jdk1.6.0_07/bin/java -XX:NewSize=32m -Xms128m -Xmx128m Test
Error occurred during initialization of VM
Could not reserve enough space for object heap
%
% /jdk1.6.0_12/bin/java -XX:NewSize=32m -Xms128m -Xmx128m Test
Error occurred during initialization of VM
Could not reserve enough space for object heap
%
% /jdk1.6.0_13/bin/java -XX:NewSize=32m -Xms128m -Xmx128m Test
Error occurred during initialization of VM
Could not reserve enough space for object heap
%
3. Compare: run on 6u3
----------------------
% /jdk1.6.0_03/bin/java -XX:NewSize=32m -Xms128m -Xmx128m Test
Hello
%
4. Increase NewSize value
-------------------------
% /jdk1.6.0_13/bin/java -XX:NewSize=39m -Xms128m -Xmx128m Test
Error occurred during initialization of VM
Could not reserve enough space for object heap
% /jdk1.6.0_13/bin/java -XX:NewSize=40m -Xms128m -Xmx128m Test
Hello
%
5. Add MaxNewSize parameter
---------------------------
% /jdk1.6.0_13/bin/java -XX:NewSize=32m -XX:MaxNewSize=64m -Xms128m -Xmx128m Test
Error occurred during initialization of VM
Could not reserve enough space for object heap
% /jdk1.6.0_13/bin/java -XX:NewSize=32m -XX:MaxNewSize=32m -Xms128m -Xmx128m Test
Hello
%
- duplicates
-
JDK-6979312 1.5.0_24 heap generation size calculation problem
-
- Closed
-
- relates to
-
JDK-6524727 GC ergonomics does not honor the minimum young gen size implied by a -Xms and NewRatio
-
- Resolved
-