I have created a java application and many users use it. I have bundled the application in an exe file, where it is being run using this command :
java -jar -Xms256m -Xmx1024m MyApplication.jar
I am using this high "-Xmx" value because sometimes the application may need high memory to work or it may cause "Out of memory" error.
The application runs just fine for me, as i have 3GB Rams, but many other users get the error "Could not create the Java virtual machine" at startup because they have low memory: 1.5GB, or 2GB.
I am stuck here between the 2 errors "Out of memory" and "Could not create the Java virtual machine" !!
Is there a java parameter to reserve 1024 memory if this memory is available, and if not then reserve the maximum memory it can when needed ?