I am running into a problem where I have an installer for a Java application. I want to run this Java application with the maximum amount of memory possible and have tested with -Xmx1024M without a problem.
Apparently, some people have run into issues where they have plenty of memory, but they're getting 'not enough memory errors'. This can be solved by reducing the -Xmx argument.
How do I tell the JVM to use up to 1024M, but less if it can't? i.e. How do I get this app to run reliably and with a lot of memory?