File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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 Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Perm Gen" Watch "Perm Gen" New topic

Perm Gen

Rafael Cassolato

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: 15100

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 8 API documentation
Galen Palmer

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

Joined: Sep 18, 2000
Posts: 14

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 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 ), 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="" target="_blank" rel="nofollow">Professional Apache Tomcat 6</a>
David O'Meara

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:
subject: Perm Gen
It's not a secret anymore!