I usually have many Flex projects deployed on my Tomcat server at any given time. Usually 5-10 will be running. When I execute 3 of these larger Flex applications I use to get memory errors. I have found a couple Java Options that have helped with the server not running out of memory.

The first Java Option parameters to set are -Xms (minimum heap size) and -Xmx (maximum heap size). I usually start with a lower -Xms number so the heap can build up to the max -Xmx size if needed. This way I do not partition a portion of memory that may not be used. The setting I use on development and production servers is:

 -Xms 256m -Xmx 1024m

The second Java Option to look at is the MaxPermSize. The permanent generation is used to hold reflective data of the VM itself such as class objects and method objects. PermSize is an addition to the -Xmx value. I have set the following MaxPermSize in development and production:

-XX:MaxPermSize=128m

You can set these parameters in Tomcat using the Configure Tomcat application on the Java VM tab.

Be sure you have enough memory on the web server you are allocating memory for. The Windows servers I am referring to have 4 gigs of RAM.