This week's book giveaway is in the Server-Side JavaScript and NodeJS forum.
We're giving away four copies of Node.js Design Patterns: Design and implement production-grade Node.js applications using proven patterns and techniques and have Mario Casciaro & Luciano Mammino on-line!
See this thread for details.
Win a copy of Node.js Design Patterns: Design and implement production-grade Node.js applications using proven patterns and techniques this week in the Server-Side JavaScript and NodeJS 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

java.lang.OutOfMemoryError: PermGen space on Tomcat6

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
MyEclipse IDE Firefox Browser Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Seriously Rick? Seriously? You might as well just read this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic