Results 1 to 3 of 3

Thread: Tomcat - java.lang.OutOfMemoryError: PermGen space

  1. #1
    ronniev's Avatar
    ronniev is offline Forum Member
    Join Date
    Oct 2008

    Default Tomcat - java.lang.OutOfMemoryError: PermGen space

    Tomcat - java.lang.OutOfMemoryError: PermGen space

    When you access .jsp page then some times 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
    Solution is :

    It needs to increase the memory by making changes in file.

    Follow 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 -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.

    Save and exit
    Then restart the tomcat

    root@server[~]# /usr/local/jakarta/tomcat/bin/./
    root@server[~]# /usr/local/jakarta/tomcat/bin/./
    root@server[~]# /usr/local/jakarta/tomcat/bin/./ run
    root@server[~]# /scripts/restartsrv tomcat

  2. #2
    Rock's Avatar
    Rock is offline Technical Support (
    Join Date
    Oct 2006


    Yep, I've seen this error popping too many times when working with Java issues.. I'd need to search over Google to pass through it :wink: Thank you for posting it here Ronnie, it'd be helpful for the others too...
    Rock _a.k.a._ Jack Daniel

    Follow eUKhost on Twitter || Join eUKhost Community on Facebook

  3. #3
    bellurashwin is offline Forum Member
    Join Date
    Feb 2010


    Thanks mate. Works fine for me with changes mentioned in your post.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
About eUKhost
We're a Leeds-based web hosting provider specialising in Linux- and Windows-based hosting solutions now serving over 35,000 customers worldwide. Across our network, we host over 2 million websites in our state-of-the-art data centres in Reading, Maidenhead and Milton Keynes. Find out more.
we're social

Copyright © 2014, 2015. eUKhost Ltd. All rights are reserved.

The opinions or views of users on the forum are those of the author and not of eUKhost Ltd.