1
Solving "Tomcat - java.lang.OutOfMemoryError: PermGen space" in linux
src : http://www.eukhost.com/forums/f33/tomcat-java-lang-outofmemoryerror-permgen-space-7675/
When you come across following error
java.lang.OutOfMemoryError: PermGen space
Follow the following steps :
1) vi /usr/local/jakarta/tomcat/bin/catalina.sh
2) Add following line into the catalina.sh file.
Partial example of catalina.sh file
Save and exit
Then restart the tomcat
root@server[~]# /usr/local/jakarta/tomcat/bin/./startup.sh
root@server[~]# /usr/local/jakarta/tomcat/bin/./catalina.sh run
root@server[~]# /scripts/restartsrv tomcat
When you come across following error
java.lang.OutOfMemoryError: PermGen space
Follow the following steps :
1) vi /usr/local/jakarta/tomcat/bin/catalina.sh
2) Add following line into the catalina.sh file.
Quote:
JAVA_OPTS="-Djava.awt.headless=true -Dfile.encoding=UTF-8 -server -Xms512m -Xmx1024m -XX:NewSize=256m -XX:MaxNewSize=256m -XX:PermSize=256m -XX:MaxPermSize=256m -XX:+DisableExplicitGC" |
Partial example of catalina.sh file
Quote:
=========================================== # JSSE_HOME (Optional) May point at your Java Secure Sockets Extension # (JSSE) installation, whose JAR files will be added to the # system class path used to start Tomcat. # # CATALINA_PID (Optional) Path of the file which should contains the pid # of catalina startup java process, when start (fork) is used # # $Id: catalina.sh 609438 2008-01-06 22:14:28Z markt $ # ----------------------------------------------------------------------------- JAVA_OPTS="-Djava.awt.headless=true -Dfile.encoding=UTF-8 -server -Xms512m -Xmx1024m -XX:NewSize=256m -XX:MaxNewSize=256m -XX:PermSize=256m -XX:MaxPermSize=256m -XX:+DisableExplicitGC" # OS specific support. $var _must_ be set to either true or false. cygwin=false os400=false darwin=false ======================================== |
Then restart the tomcat
Quote:
root@server[~]# /usr/local/jakarta/tomcat/bin/./shutdown.shroot@server[~]# /usr/local/jakarta/tomcat/bin/./startup.sh
root@server[~]# /usr/local/jakarta/tomcat/bin/./catalina.sh run
root@server[~]# /scripts/restartsrv tomcat