If you use JPA with Hibernate, CDI with Weld, then the default Tomcat PermGen (permanent Generation) size is soon becoming too small – already for dev purposes without user load…

E.g., if you have 2GB of RAM, reserve 1GB for your OS, you could give a dedicated Tomcat server about 1GB:

If you’re using the startup.bat, append following line in catalina.bat in front of JAVA_OPTS:
-Xms1024m -Xmx1024m -XX:MaxPermSize=128m

set JAVA_OPTS=%JAVA_OPTS% -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.util.logging.config.file="%CATALINA_BASE%\conf\logging.properties" -Xms1024m -Xmx1024m -XX:MaxPermSize=128m

You also could add a new environment variable called JAVA_OPTS with value -Xms1024m -Xmx1024m -XX:MaxPermSize=128m

I also was in the situation of a Win XP machine with 512MB of RAM, where I set -Xms256m -Xmx256m -XX:MaxPermSize=64m. There could not run any more processes without starting to page… There also ran a HSQLDB, and sometimes I opened Eclipse together with Firefox :-)

, ,

Add reply