aspose file tools*
The moose likes Tomcat and the fly likes Perm Gen Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Perm Gen" Watch "Perm Gen" New topic
Author

Perm Gen

Rafael Cassolato
Greenhorn

Joined: Sep 20, 2007
Posts: 3
The perm gen error, went resolved ?


Rafael Cassolato - SCJA - SCJP 1.4- - SCJD- SCWCD 5
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14114
    
  16

Can you please explain what your question is about? Does it have anything to do with Tomcat?

How to ask questions on JavaRanch


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
Galen Palmer
Greenhorn

Joined: Aug 09, 2007
Posts: 29
I think the question is related to the memory leak that happens when a .war is repeatably deployed in a running Tomcat instance. Eventually, you get a out of memory error; generally, "OutofMemoryException: PermGen space" but I get a slightly different behavior on my Mac versus my Linux box.

I read on another forum that this was not specifically a Tomcat problem but a problem with the "cglib".

In any case, even if it's not a Tomcat 5.5 issue I also wonder if Tomcat 6 has managed to work around the problem?
Vivek Chopra
Author
Greenhorn

Joined: Sep 18, 2000
Posts: 14
Rafael,

PermGen space errors sometimes occur if you run multiple Web applications in single Tomcat instance, or if your application loads up a lot of classes. The JVM allocates a 64MB memory chunk for the permanent generation heap, which is the heap that holds objects such as classes and methods. When this space gets exceeded, you start getting the PermGen space errors. You would need to increase this setting: Use the -XX:MaxPermSize option in Sun�s JDK to increase the permanent generation heap space. The place to set this would be to edit your catalina.sh/.bat file and add it to the JAVA_OPTS environment variable.

PermGen errors can also occur if a web application is repeatedly 'hot deployed' in an running Tomcat instance. There as a Tomcat 5.5 bug on this (see http://issues.apache.org/bugzilla/show_bug.cgi?id=40679 ), which is supposedly fixed.

- Vivek

[ October 03, 2007: Message edited by: Vivek Chopra ]
[ October 03, 2007: Message edited by: Vivek Chopra ]

Vivek Chopra<br />Author of <a href="http://www.amazon.com/exec/obidos/ASIN/0471753610/soapsimpleobject/" target="_blank" rel="nofollow">Professional Apache Tomcat 6</a>
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

We were getting a lot of these in TC6 so I added the following to catalina.bat (there are other ways to set this value, but I stick with what works for me ;) )

SET JAVA_OPTS=-XX:PermSize=64M -XX:MaxPermSize=128M
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Perm Gen