[Logo] Enterprise Client Community
  [Search] Search   [Recent Topics] Recent Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
OutOfMemoryError: PermGen space  XML
Forum Index -> Development
Author Message
schmuck

Power User
[Avatar]

Joined: 08/04/2008 16:27:16
Messages: 83
Offline

Hello,

I get very often this Expetion after reloading the server for several times.

After profiling the server, I can say that my sourcecoode should not waist any memory. The Heap Space is nearly empty.

Here is the Stacktrace, thrown on the client side.

javax.faces.el.EvaluationException: java.lang.OutOfMemoryError: PermGen space
at com.sun.faces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:130)
at org.eclnt.jsfserver.elements.MethodBindingDelegator.invoke(MethodBindingDelegator.java:55)
at org.eclnt.jsfserver.elements.BaseActionComponent.broadcast(BaseActionComponent.java:196)
at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:267)
at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:381)
at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:75)
at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:90)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:197)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.eclnt.jsfserver.util.ThreadingFilter.doFilter(ThreadingFilter.java:109)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.eclnt.jsfserver.util.CompressionFilter.doFilter(CompressionFilter.java:33)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:12
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:263)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:584)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.OutOfMemoryError: PermGen space
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Unknown Source)
at java.lang.Class.getDeclaredMethod(Unknown Source)
at java.io.ObjectStreamClass.getPrivateMethod(Unknown Source)
at java.io.ObjectStreamClass.access$1700(Unknown Source)
at java.io.ObjectStreamClass$2.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.io.ObjectStreamClass.<init>(Unknown Source)
at java.io.ObjectStreamClass.lookup(Unknown Source)
at java.io.ObjectStreamClass.initNonProxy(Unknown Source)
at java.io.ObjectInputStream.readNonProxyDesc(Unknown Source)
at java.io.ObjectInputStream.readClassDesc(Unknown Source)
at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
at java.io.ObjectInputStream.readObject0(Unknown Source)
at java.io.ObjectInputStream.readObject(Unknown Source)
at java.util.ArrayList.readObject(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at java.io.ObjectStreamClass.invokeReadObject(Unknown Source)
at java.io.ObjectInputStream.readSerialData(Unknown Source)
at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
at java.io.ObjectInputStream.readObject0(Unknown Source)
at java.io.ObjectInputStream.defaultReadFields(Unknown Source)
at java.io.ObjectInputStream.readSerialData(Unknown Source)
at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
at java.io.ObjectInputStream.readObject0(Unknown Source)
at java.io.ObjectInputStream.defaultReadFields(Unknown Source)
at java.io.ObjectInputStream.readSerialData(Unknown Source)
at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
at java.io.ObjectInputStream.readObject0(Unknown Source)
[ICQ]
CaptainCasa

Power User
[Avatar]

Joined: 21/11/2007 12:23:06
Messages: 5520
Offline

Yes, this error occurs when the reloading of the webapp is always reloading a big chunk of classes (permgen somehow is the memory in which the class code itself is managed): Hibernate, JDBC, ... Realoding is done quite oftenly within the Layout Editor.

First activity: increase the PermGen Size:
Parameter: -XX:MaxPermSize=256m

Example:

Code:
 set JAVA_HOME=
 set JRE_HOME=jre
 set CATALINA_HOME=tomcat
 set JAVA_OPTS=-XX:MaxPermSize=256m
 tomcat/bin/catalina run
 


Second activity: there is a hot deployment concept within CaptainCasa which might be useful for you. It was introduced some weeks ago, because a customer had quite long reload times with his applicaiton.

Result: if the PermGenSize "solves" your problem ("solves" ==> increases the time until OutOfMemory...): fine! If you in general have the problem of long reload times...: contact us back!

Björn

Björn Müller, CaptainCasa GmbH
gjones

Power User

Joined: 30/06/2009 16:52:33
Messages: 38
Offline

I'm seeing something similar:
Code:
13-Aug-2009 10:27:31 org.apache.catalina.core.ApplicationDispatcher invoke
 SEVERE: Servlet.service() for servlet jsp threw exception
 java.lang.OutOfMemoryError: PermGen space
 13-Aug-2009 10:27:46 org.apache.catalina.core.ApplicationDispatcher invoke
 SEVERE: Servlet.service() for servlet jsp threw exception
 java.lang.OutOfMemoryError: PermGen space
 

despite having the JAVA_OPTS set as described. Do you have any more clues for us?
CaptainCasa

Power User
[Avatar]

Joined: 21/11/2007 12:23:06
Messages: 5520
Offline

Hi,

the PermGem out of memory happens because of realoding the webapp during development. This something like "fix" - reloading increases the size of permgen memory.

Our layout editor is decoupled from this, so you can restart Tomcat without having to restart the layout editor (as it was up to relase 2.0 ...).

We introduced a smart(er) concept for controlling that only parts of the classes need to be reloaded (see Developers' Guide), but this comes with the cost, that you have to clearly separate UI classes and procesing classes (which is a good idea anyway...). ...and, in prinicipal, it will always cause permgen out of memory, but just later. Reloading classes costs memory.

Björn

Björn Müller, CaptainCasa GmbH
gjones

Power User

Joined: 30/06/2009 16:52:33
Messages: 38
Offline

Thanks, I will look into this. It is definitely related to the reloading during development, that's where I have seen it every time. I know it isn't really your "fault", I've seen it often enough before.

And yes, I totally agree about separating the UI classes from the processing classes!
 
Forum Index -> Development
Go to:   
Powered by JForum 2.1.6 © JForum Team