Tomcat out of memory error permgen space

Saturday, 30 June 2012 0 comments

How to fix tomcat out of memory error permgen space,Tomcat config,tomcat permgen error, tomcat problem when start.

when start the tomcat the application not up and the logs show error like out of memory error permgen space how to solve the memory problem.

for this problem just allocate more memory for ur application and mention that is tomcat.the configuration steps are given below.

  • open the setclasspath.sh file in text editor.
  • it is placed in apache-tomcat/bin/setclasspath.sh
  • then find the $JAVA_ENDORSED_DIRS in the setclasspath file
  • paste the following code JAVA_OPTS="$JAVA_OPTS -Xms128m -Xmx512m -XX:PermSize=32m -XX:MaxPermSize=128m -Xss2m" on the if condtion.
before memory allocation,

        # Don't override the endorsed dir if the user has set it previously
        if [ -z "$JAVA_ENDORSED_DIRS" ]; then
               # Set the default -Djava.endorsed.dirs argument
               JAVA_ENDORSED_DIRS="$BASEDIR"/endorsed
        fi

after memory allocation,

        # Don't override the endorsed dir if the user has set it previously
        if [ -z "$JAVA_ENDORSED_DIRS" ]; then
               # Set the default -Djava.endorsed.dirs argument
               JAVA_ENDORSED_DIRS="$BASEDIR"/endorsed
               JAVA_OPTS="$JAVA_OPTS -Xms128m -Xmx512m -XX:PermSize=32m -XX:MaxPermSize=128m -Xss2m"
        fi

  • increase MaxPermSize memory size based on the application reqirement
                   JAVA_OPTS="$JAVA_OPTS -Xms128m -Xmx512m -XX:PermSize=32m -XX:MaxPermSize=128m -Xss2m"

Thank you,hope it's help you guys.