Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Perm Gen

 
Rafael Cassolato
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The perm gen error, went resolved ?
 
Jesper de Jong
Java Cowboy
Saloon Keeper
Posts: 15284
39
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you please explain what your question is about? Does it have anything to do with Tomcat?

How to ask questions on JavaRanch
 
Galen Palmer
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic