tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Timo Meinen | mindmatters <Timo.Mei...@mindmatters.de>
Subject Memory analysis after 'OutOfMemoryError PermGen space' error induced by redeployments
Date Tue, 23 Jun 2009 08:26:08 GMT
Hello,

we host a Tomcat 6 server with several webapps on it. It is used for  
continuous integration, so the test webapps are deployed often. We run  
into OutOfMemoryError: PermGen space after some redeployments and  
cannot find a solution.

I connected JConsole remotely and made a screenshot after some  
redeployments. The screenshot is attached to this mail. After the  
first redeployment of webapp 1 the PermGen raises to 150MB and after  
the deployment it is freed to 115 MB, which seems to be ok. However,  
the second redeployment won't release the PermGen as you can see on  
the screenshot. After that, every redeployment will take another 40MB  
of PermGen space wich leads to the OutOfMemory error, because we set  
the MaxPermSize to 256m.

I tried a manual GC, but this worked only once (see screenshot). After  
this, the GC was useless.


The start parameters of the tomcat server are:

-server -Xmx1g -XX:MaxPermSize=256m -XX:+CMSClassUnloadingEnabled - 
Djava.awt.headless=true - 
javaagent:org.springframework.instrument-3.0.0.M2.jar


The stacktrace is:

SEVERE: org/springframework/web/context/request/ 
AbstractRequestAttributes
java.lang.OutOfMemoryError: PermGen space
	at java.lang.Class.getDeclaredMethods0(Native Method)
	at java.lang.Class.privateGetDeclaredMethods(Class.java:2427)
	at java.lang.Class.getDeclaredMethod(Class.java:1935)
	at java.io.ObjectStreamClass.getPrivateMethod(ObjectStreamClass.java: 
1382)
	at java.io.ObjectStreamClass.access$1700(ObjectStreamClass.java:52)
	at java.io.ObjectStreamClass$2.run(ObjectStreamClass.java:438)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.io.ObjectStreamClass.<init>(ObjectStreamClass.java:413)
	at java.io.ObjectStreamClass.lookup(ObjectStreamClass.java:310)
	at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java: 
1106)
	at  
java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java: 
1509)
	at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java: 
1474)
	at  
java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java: 
1392)
	at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java: 
1150)
	at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:326)
	at java.util.ArrayList.writeObject(ArrayList.java:570)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at  
sun 
.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java: 
39)
	at  
sun 
.reflect 
.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java: 
25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java: 
945)
	at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java: 
1461)
	at  
java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java: 
1392)
	at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java: 
1150)
	at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:326)
	at sun.rmi.server.UnicastRef.marshalValue(UnicastRef.java:274)
	at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:315)
	at sun.rmi.transport.Transport$1.run(Transport.java:159)
	at java.security.AccessController.doPrivileged(Native Method)
	at sun.rmi.transport.Transport.serviceCall(Transport.java:155)
	at  
sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:535)
	at sun.rmi.transport.tcp.TCPTransport 
$ConnectionHandler.run0(TCPTransport.java:790)


And the screenshot:


Mime
View raw message