When trying to launch and run a flex/java project in eclipse I kept getting a \"Out of Memory Exception\" and \"Java Heap Space\" using Eclipse, Tomcat and a JRE.
Wh
First of all, I suggest that you narrow the problem to which component throws the "Out of Memory Exception".
This could be:
The JVM parameters -xms
and -xmx
represent the heap's "start memory" and the "maximum memory". Forget the "start memory". This is not going to help you now and you should only change this parameter if you're sure your app will consume this amount of memory rapidly.
In production, I think the only parameter that you can change is the -xmx
under the Catalina.sh or Catalina.bat files. But if you are testing your webapp directly from Eclipse with a configured debug environment of Tomcat, you can simply go to your "Debug Configurations" > "Apache Tomcat" > "Arguments" > "VM arguments" and set the -xmx
there.
As for the optimal -xmx
for 2gb, this depends a lot of your environment and the number of requests your app might take. I would try values from 500mb up to 1gb. Check your OS virtual memory "zone" limit and the limit of the JVM itself.