Initial heap size set to a larger value than the maximum heap size


Contents of page :
  • 2) Now, we will pass VM parameters to java program to produce - Error occurred during initialization of VM - Initial heap size set to a larger value than the maximum heap size
  • 3) Solution of problem - Initial heap size set to a larger value than the maximum heap size >





2) Now, we will pass VM parameters to java program to produce - Error occurred during initialization of VM - Initial heap size set to a larger value than the maximum heap size >

Pass VM/JVM parameters -Xms and -Xmx
E:\>java -Xms2g -Xmx1g MyJavaProgram
Error occurred during initialization of VM
Initial heap size set to a larger value than the maximum heap size

E:\>




-Xms : Xms is minimum heap size which is allocated at initialization of JVM in java.
And
Xmx : Xmx is the maximum heap size that JVM can use.

Here, value of Xms is set greater than Xmx.

Currently Xms (minimum heap size) is set to 2 gigabyte and
Xmx (maximum heap size) is set to 1 gigabyte.



3) Solution of problem - Initial heap size set to a larger value than the maximum heap size >


Keep value of Xms less than Xmx.

We have set Xms (minimum heap size) to 1 gigabyte and Xmx (maximum heap size) to 2 gigabyte.


E:\>java -Xms1g -Xmx2g MyJavaProgram
This is my Java Program

E:\>








SUMMARY>
So in this core java tutorial we learned how to solve Initial heap size set to a larger value than the maximum heap size.


Having any doubt? or you liked the tutorial! Please comment in below section.
Please express your love by liking JavaMadeSoEasy.com (JMSE) on facebook, following on google+ or Twitter.



RELATED LINKS>

What is eclipse.ini file? How to pass vmargs to java program in eclipse? Changing the eclipse setting, What are best eclipse setting?





No comments:

Post a Comment