I got this Error when I run a java class which has an NLP library ....
Error occurred during initialization of VM Incompatible initial and maximum heap sizes specified
any idea how i can solve this error :)
64 bit JVM installed on Solaris machines runs with a 32-bit model if you don't specify either -d32 or -d64, which won't accept a Maximum heap size of 4GB, hence "invalid heap size". You can resolve this issue by running Solaris JVM with option -d64.
To get rid of this error, the value of Xmx(maximum heap size) should always be greater than or equal to Xms(minimum heap size). Run the HelloWorld program with the value of Xms(minimum heap size) set to 1 gigabyte and Xmx(maximum heap size) set to 2 gigabytes.
Initial heap size is 1/64th of the computer's physical memory or reasonable minimum based on platform (whichever is larger) by default. The initial heap size can be overridden using -Xms. Maximum heap size is 1/4th of the computer's physical memory or 1 GB (whichever is smaller) by default.
Max Heap Size. The maximum theoretical heap limit for the 32-bit and 64-bit JVM is easy to determine by looking at the available memory space, 2^32 (4 GB) for 32-bit JVM and 2^64 (16 Exabytes) for 64-bit JVM. In practice, due to various constraints, the limit can be much lower and varies given the operating system.
You should note that in case of setting initial heap size bigger than maximum one, application will produce such error
-Xms
means initial heap size-Xmx
means maximum heap size allowed for particular JVM
java -Xms128m MyClass
java -Xms128m -Xmx128m MyClass
Read more here http://javahowto.blogspot.com/2006/06/6-common-errors-in-setting-java-heap.html
And useful is too, to understand those two arguments, read more here if you're interested:
Speed tradeoff of Java's -Xms and -Xmx options
What are the Xms and Xmx parameters when starting JVMs?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With