Thursday, June 19, 2014

Out of memory Issue in Tomcat

Description of Exception 
(Tomcat – java.lang.OutOfMemoryError: PermGen space)

The exception happens in web application deployment in tomcat.
Default settings memory space will not be adequate for some search information requirements.















If we check the tomcat error log, we might caught-up the issue as follows :
















Solution for Linux environment

1) Find out catalina.sh file in tomcat bin folder
           
2) Check for class path settings.
    Use setenv.sh instead to run the environment variable
    Set as follows :
   CLASSPATH=
 
    if [ -r "$CATALINA_BASE/bin/setenv.sh" ]; then
     . "$CATALINA_BASE/bin/setenv.sh"
    elif [ -r "$CATALINA_HOME/bin/setenv.sh" ]; then
     . "$CATALINA_HOME/bin/setenv.sh"
    fi
 
3) Check for setenv.sh in tomcat bin folder
    Check if it is there, if not create manually and enter the following to it.

export JAVA_OPTS="-Dfile.encoding=UTF-8 -Xms128m -Xmx1024m -XX:PermSize=64m -XX:MaxPermSize=256m"

4) Restart Tomcat
   
      

 




No comments:

Post a Comment