Something Different In Linux

Home » Tomcat » Tomcat – java.lang.OutOfMemoryError: PermGen space

Tomcat – java.lang.OutOfMemoryError: PermGen space

Posted by Rishikesh Vispute Categories: Tomcat

Tomcat – java.lang.OutOfMemoryError: PermGen space

When you have access the .jsp page then some time it shows the following error on the page.

HTTP Status 500 –
type Exception report
description The server encountered an internal error () that prevented it from fulfilling this request.
javax.servlet.ServletException: Servlet execution threw an exception
root cause
java.lang.OutOfMemoryError: PermGen space
note The full stack trace of the root cause is available in the Apache Tomcat/5.5.25 logs.
Apache Tomcat/5.5.25

We need to increase the memory by make change in or catalina.bat file.

Use the  following steps :

1) vi /usr/local/jakarta/tomcat/bin/

2)  Add following line into the file.

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 file

#   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: 609438 2008-01-06 22:14:28Z markt $
# —————————————————————————–

JAVA_OPTS="-Djava.awt.headless=true -Dfile.encoding=UTF-8 -server -Xms512m -Xmx2048m -XX:NewSize=512m -XX:MaxNewSize=512m -XX:PermSize=512m -XX:MaxPermSize=512m -XX:+DisableExplicitGC

# OS specific support.  $var _must_ be set to either true or false.

Popular Posts

remove index.php fro

How to remove index.php from url in magento Ans : If you ...

PHP-Java bridge on p

  What is php-java bridge? The php-java bridge is the php ...

Set expiration for y

If you want to set the expiration to your site ...

Warning: Parameter 1

Error: Warning: Parameter 1 to modMainMenuHelper::buildXML() expected to be a ...

domain pointing to e

If you domain uses external MX record and it is ...