I am working on a webapp that is deployed in Weblogic. After a few re-deployments PermGen ran out of space so I had to conclude that the webapp has a class loader leak...
I am using Yourkit to investigate that leak, but find myself stuck as I don't even know which class loader is leaking: when I do a memory dump and open it, Yourkit shows me dozens (more exactly: 289) of class loader instances. From the name I can guess that some of them are not the ones, but that still leaves many possibilities.
I tried to compare the list of class loaders before / after using the application (is it a valid approach?), but it does not help because most class loaders are instances of the same couple of classes, so I don't know which instance is the one I am interested in.
The class loaders classes reported by Yourkit are:
- sun.misc.Launcher$AppClassLoader
- weblogic.utils.classloaders.GenericClassLoader
- weblogic.utils.classloaders.ChangeAwareClassLoader
- java.net.URLClassLoader sun.misc.Launcher$ExtClassLoader
- weblogic.servlet.jsp.JspClassLoader
- weblogic.diagnostics.query.QueryCompiler
- sun.reflect.DelegatingClassLoader
- javax.management.remote.rmi.NoCallStackClassLoader
If you know already which of these is used by Weblogic to load the classes of a webapp, that would already help as I did not find it in Weblogic documentation. And can anyone suggest a methodology to find the particular class loader instance?