users@glassfish.java.net

PermGen problem - class loader does not collect

From: <glassfish_at_javadesktop.org>
Date: Wed, 18 Jun 2008 04:08:20 PDT

Hi,
I know this is an old issue, but I haven't find a definite solution yet.

My setup:
Sun Java System Application Server 9.1 (build b58-fcs)
Suse 13, on a 4-core machine
java -version prints:

java version "1.6.0_04"
Java(TM) SE Runtime Environment (build 1.6.0_04-b12)
Java HotSpot(TM) 64-Bit Server VM (build 10.0-b19, mixed mode)

I have a .war file in the autodeploy folder, and I "touch" it repeatedly, and it gets reloaded, but the previously loaded web app is not garbaged collected.

I get a heap dump of glassfish, go one of the uncollected WebappClassLoaders and try to find the "nearest GC root", but there is none. So it seems that these are really collectable, so there should be no memory leak.

I have put these JVM options:
-XX:+UseConcMarkSweepGC
-XX:+CMSPermGenSweepingEnabled
-XX:+CMSClassUnloadingEnabled

Does anyone knows why the garbage collector still does not collect from the PermGen space? (It does not, with or without these switches). What can I do to resolve this issue?

Dimitris Andreou
[Message sent by forum member 'andreou' (andreou)]

http://forums.java.net/jive/thread.jspa?messageID=280979