| Author |
java.lang.OutOfMemoryError: PermGen space on Tomcat6
|
Paolo Rossi
Greenhorn
Joined: Jan 10, 2013
Posts: 1
|
|
Hi all,
I have 2 installations of Tomcat6 running as a windows services on a machine: Tomcat1 (port 8080) and Tomcat2 (port 8081).
I have a web application that comes with 4 war files which are deployed on each port:
A.war = 65MB
B.war = 40MB
C.war = 30MB
D.war = 95MB
The war files work without a problem on Tomcat1.
However, I am unable to deploy them all on Tomcat2 and I hit the error below when I deploy C.war:
Caused by: java.lang.OutOfMemoryError: PermGen space
Exception in thread "State Saver" java.lang.OutOfMemoryError: PermGen space
Exception in thread "http-8081-6" java.lang.OutOfMemoryError: PermGen space
Exception in thread "Spring DM Context Creation Timer" java.lang.OutOfMemoryError: PermGen space
Exception in thread "http-8081-1" java.lang.OutOfMemoryError: PermGen space
java.lang.reflect.InvocationTargetException
I have seen other similar posts and tried to set my JAVA_OPTS windows environment varaibles to
-Xmx1024m -XX:NewSize=256m -XX:MaxNewSize=256m -XX:PermSize=256m -XX:MaxPermSize=512m -XX:+CMSClassUnloadingEnabled XX:+CMSIncrementalMode -XX:+UseConcMarkSweepGC
but still does not work. It fails even with -XX:MaxPermSize=1024m
However if I run Tomcat2 from the binaries using startup.bat, it all works - my setenv.bat is set up with the below parameters:
SET CATALINA_HOME=C:\APACHE_TOMCAT\Tomcat1
SET CATALINA_OPTS=-Dcom.sun.management.jmxremote
SET JAVA_OPTS=-XX:MaxPermSize=512m -Dfile.encoding=UTF-8
So I seems to be able to only have Tomcat1 as windows service, while Tomcat2 as to run from the binaries...is that possible?
Is there a solution/reason?
Thanks very much in advance.
|
 |
Deepak Bala
Bartender
Joined: Feb 24, 2006
Posts: 6603
|
|
|
I'd start by making sure that the java options are passed to the server. Connect to the server using JMX and check the perm gen size using jconsole or jvisualvm.
|
SCJP 6 articles - SCJP 5/6 mock exams - SCJP Mocks - SCJP 5 Mock exam (Word document ) - SCJP 5 Mock exam in Java.Inquisition format
|
 |
 |
|
|
subject: java.lang.OutOfMemoryError: PermGen space on Tomcat6
|
|
|