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
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 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?