Hi,

My co-worker and I decided to try to debug PermGen problems after detailed reading of mailing list archives and Tomcat wiki.

We followed the procedure described at the wiki [1], and got one inactive WebappClassLoader (started = false), with 18 GC root paths. They are attached to the message (relevant ones). In the attached list there isn't a single class developed in-house, but are mostly from third-party jars.

The first one, org.postgresql.Driver I think I understand.

postgresql-*.jar is located in Tomcat's lib folder, so it is loaded with Tomcat class loader in order to create DB pool. Then, it is used by some of webapp libraries, which I guess is OpenJPA. However, I don't have a clue how to deregister it. I tried to do it in contextDestroyed of registered ServletContextListener, but no success. It seems that I cannot access registered drivers from different classloader. org.postgresql.Driver is loaded from Tomcat class loader, and ServletContextListener is being loaded from webapp class loader, so no luck. Any ideas how to clean up the driver on application unload?

The second root path is even worse. UploadedFile (which is very simple class part of MyFaces) seems to be referenced in static HashTable "registry" in class PropertyEditorManager. I can't find who made that registration, but I believe it is not in my code. I would like to ask developers to fix the problem (or try to fix it myself) but I am unable to pin-point what is the cause of the problem. Any ideas with this one?

Environment: Tomcat 6.0.14, Windows XP SP2.

Regards,
Ognjen

[1] http://wiki.apache.org/tomcat/OutOfMemory


------
GC root paths (relevant part):

Paths from "GC Roots" to "Object WebappClassLoader #054435C8"

+----------------------------------------------------------------------
|                                                                 Name
+----------------------------------------------------------------------
|  +---org.apache.catalina.loader.WebappClassLoader
|    |
|    +---<loader> of org.postgresql.Driver
|    | |
|    | +---driverClass of java.sql.DriverInfo
|    |   |
|    |   +---[1] of java.lang.Object[10]
|    |     |
|    |     +---elementData of java.util.Vector
|    |       |
|    |       +---writeDrivers of java.sql.DriverManager [Class]
|    |
|    +---<loader> of org.apache.myfaces.custom.fileupload.UploadedFile
|    | |
|    | +---key of java.util.Hashtable$Entry
|    |   |
|    |   +---[10] of java.util.Hashtable$Entry[23]
|    |     |
|    |     +---table of java.util.Hashtable
|    |       |
|    |       +---registry of java.beans.PropertyEditorManager [Class]


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to