Question

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:

  1. sun.misc.Launcher$AppClassLoader
  2. weblogic.utils.classloaders.GenericClassLoader
  3. weblogic.utils.classloaders.ChangeAwareClassLoader
  4. java.net.URLClassLoader sun.misc.Launcher$ExtClassLoader
  5. weblogic.servlet.jsp.JspClassLoader
  6. weblogic.diagnostics.query.QueryCompiler
  7. sun.reflect.DelegatingClassLoader
  8. 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?

Was it helpful?

Solution

I finally resorted to look at the list of loaded classes for each instance of GenericClassLoader and ChangeAwareClassLoader (as they seemed to be the likeliest ones) and checked if they had my own classes (filtering on package). The webapp class loader is an instance of ChangeAwareClassLoader.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top