Error occurred during initialization of VM - Too small initial heap


Contents of page :

  • 2) Now, we will pass VM parameters to java program to produce - Error occurred during initialization of VM Too small initial heap
  • 3) Solution of problem - Error occurred during initialization of VM Too small initial heap >



How to pass vmArgs(JVM parameters) to java program in eclipse



2) Now, we will pass VM parameters to java program to produce - Error occurred during initialization of VM Too small initial heap>

Pass VM/JVM parameters -Xms

E:\>java -Xms512 MyJavaProgram
Error occurred during initialization of VM
Too small initial heap

E:\>


Xms is minimum heap size which is allocated at initialization of JVM in java.

Xms set is too low.

Currently Xms (minimum heap size) is set to 512 bytes.




3) Solution of problem - Error occurred during initialization of VM Too small initial heap>


Increase Xms size.

We have set Xms (minimum heap size) is set to 512 megabytes.

This value may depend on your system configuration, so adjust accordingly.

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

E:\>





How to pass vmArgs(JVM parameters) to java program in eclipse




SUMMARY>
So in this core java tutorial we learned how to solve Error occurred during initialization of VM - Too small initial heap.


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>

Learn how to pass vmargs (VM parameters) to java program in eclipse?


 

JVM in detail - Garbage collection & heap structure >

>JVM Heap memory (Hotspot heap structure) with diagram in java


>What are Minor, Major and Full garbage collection in JVM in java



Important VM parameters >

>Most important and frequently used VM (JVM) PARAMETERS with examples in JVM Heap memory in java


Monitor, analyze garbage collection and fix MEMORY LEAK >

>How to monitor and analyze the garbage collection in 10 ways in java

>Detecting and fixing memory leak in java


Labels: Core Java
eEdit
Must read for you :