We are currently working on the forum. For the short-term, all forum content will be in read-only format. We apologize for the interruption and look forward to collaborating with you shortly. All the best in your research!

Tomcat Error :: java.lang.OutOfMemoryError: PermGen space

Hello friends,
Since few days Tomcat start acting weird, occasionally the system stop working, I look into longs and here is the error
" Dec 11, 2013 10:48:08 AM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Allocate exception for servlet UpdateProfileServlet
java.lang.OutOfMemoryError: PermGen space
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2427)
at java.lang.Class.getDeclaredMethods(Class.java:1791)
at org.apache.catalina.util.DefaultAnnotationProcessor.processAnnotations(DefaultAnnotationProcessor.java:226)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1153)
at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:827)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:129)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:602)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Thread.java:662)
Dec 11, 2013 10:50:51 AM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet pages threw exception
java.lang.OutOfMemoryError: PermGen space
Dec 11, 2013 10:51:13 AM org.apache.catalina.core.StandardWrapperValve invoke"
After doing a background research I come to know it something to do with Java virtual machine PerGen space. I implement some changes into /user/local/tomcat/bin/catalina.sh. i add the code into catalina.sh file
Changes : CATALINA_OPTS="$CATALINA_OPTS -server -Xms256m -Xmx1024m -XX:PermSize=512m -XX:MaxPermSize=512m"
The system is working fine now, but being honest I am not sure if this is the right approach.
Can anyone advice / help.
Thank you very much in advance ......
--
Yama Farooq,

IT Manager, University of Oxford

Comments

  • vic-avic-a Posts: 20
    That should be ok and those may be just recommendation based on what have worked for someone in a specific type of environment.
    I would recommend that you monitor your VM. Use one of these free tools @ https://visualvm.java.net/
    Thanks
    Vic
    On Thu, Dec 12, 2013 at 1:39 AM, Yama Farooq wrote:
    Hello friends,
    Since few days Tomcat start acting weird, occasionally the system stop working, I look into longs and here is the error
    " Dec 11, 2013 10:48:08 AM org.apache.catalina.core.StandardWrapperValve invoke
    SEVERE: Allocate exception for servlet UpdateProfileServlet
    java.lang.OutOfMemoryError: PermGen space
    at java.lang.Class.getDeclaredMethods0(Native Method)
    at java.lang.Class.privateGetDeclaredMethods(Class.java:2427)
    at java.lang.Class.getDeclaredMethods(Class.java:1791)
    at org.apache.catalina.util.DefaultAnnotationProcessor.processAnnotations(DefaultAnnotationProcessor.java:226)
    at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1153)
    at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:827)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:129)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:602)
    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
    at java.lang.Thread.run(Thread.java:662)
    Dec 11, 2013 10:50:51 AM org.apache.catalina.core.StandardWrapperValve invoke
    SEVERE: Servlet.service() for servlet pages threw exception
    java.lang.OutOfMemoryError: PermGen space
    Dec 11, 2013 10:51:13 AM org.apache.catalina.core.StandardWrapperValve invoke"
    After doing a background research I come to know it something to do with Java virtual machine PerGen space. I implement some changes into /user/local/tomcat/bin/catalina.sh. i add the code into catalina.sh file
    Changes : CATALINA_OPTS="$CATALINA_OPTS -server -Xms256m -Xmx1024m -XX:PermSize=512m -XX:MaxPermSize=512m"
    The system is working fine now, but being honest I am not sure if this is the right approach.
    Can anyone advice / help.
    Thank you very much in advance ......
    --
    Yama Farooq,

    IT Manager, University of Oxford
This discussion has been closed.