Hi,
I have spent the whole day searching for a solution to this problem or atleast to get some clue in any of the forums but still not able to :(
I have a simple application just as simple as HelloWorld program that prints some message,say "Hi There", using a JOptionPane. I have created the .exe using InstallAnywhere and have specified the parameters to reserve heap as follows:
-Xms300M -Xmx2048M -Xmn80M
Unfortunately, I have a total of only 1GB RAM on my system and since I have specified -Xmx2048, the application closes immediately without even throwing OutOfMemoryException.
When I tried launching the same application using command prompt specifying the same parameters to reserve heap (java -Xms300M -Xmx2048M -Xmn80M -cp . ClassName), I could see the following error:
Error occurred during initialization of VM
Could not reserve enough space for object heap
Could not create the Java virtual machine.
I can see the above error message only when I launch it from command prompt and not when I launch it from InstallAnywhere's .exe.
However, I can see the above error message in the latter case if I keep the Ctrl key hold down while launching the application. If I dont hold down the Ctrl key, the application console simply appears for a moment and closes before user can see what exactly is happening.
Is there any way of flagging some error message to the user to indicate that VM couldn't reserve the specified heap size since it's not presently available before closing?
Any help in this regard would be highly appreciated.
Thanks,
Umesh