#AskMe

Tomcat java.lang.OutOfMemoryError: PermGen space

In Java application, PermGem memory is very important, it is used to compile and optimize classes.

You might also face this issue during deployment application in tomcat, in my case, I faced it with Tomcat 6 and 7 with message of:

<code>java.lang.OutOfMemoryError: PermGen space</code>

Solutions

Increasing the PermGem memory in “catalina.bat” for windows or “catalina.sh” by passing the parameters to JAVA_OPT as following (in Windows):

set JAVA_OPTS=%JAVA_OPTS% -Xms512m -Xmx512m 
set JAVA_OPTS=%JAVA_OPTS% -XX:NewSize=256m -XX:MaxNewSize=256m -XX:PermSize=256m -XX:MaxPermSize=256m -XX:+DisableExplicitGC

rem ----- Execute The Requested Command ---------------------------------------
<code>java.lang.OutOfMemoryError: PermGen space</code>

Above, I set:

Tips & Warning