Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

java.lang.OutOfMemoryError: PermGen space on Tomcat6

 
Paolo Rossi
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 6663
5
Firefox Browser Linux MyEclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic