This week's book giveaway is in the Cloud/Virtualization forum.
We're giving away four copies of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds and have James Denton on-line!
See this thread for details.
Win a copy of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds this week in the Cloud/Virtualization forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

java.lang.OutOfMemoryError: PermGen space on Tomcat6  RSS feed

 
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.
 
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.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!