-
1. Re: JBAS-5376: leak of webapp classloader when deployed in e
brian.stansberry Apr 7, 2008 11:45 AM (in response to brian.stansberry)LOL. Adrian looking at JBAS-5368 found the exact same thing, and doesn't appear to need my details. :-)
-
2. Re: JBAS-5376: leak of webapp classloader when deployed in e
adrian.brock Apr 7, 2008 11:58 AM (in response to brian.stansberry)The patch is fairly simple (see the change to undeploy below).
If you can't wait for the next release of jboss-deployers
then we could just copy the fixed deployer into the AS project as a temporary fix.Index: deployers-impl/src/main/org/jboss/deployers/plugins/classloading/AbstractLevelClassLoaderSystemDeployer.java =================================================================== --- deployers-impl/src/main/org/jboss/deployers/plugins/classloading/AbstractLevelClassLoaderSystemDeployer.java (revision 71766) +++ deployers-impl/src/main/org/jboss/deployers/plugins/classloading/AbstractLevelClassLoaderSystemDeployer.java (working copy) @@ -21,6 +21,7 @@ */ package org.jboss.deployers.plugins.classloading; +import org.jboss.classloader.spi.ClassLoaderDomain; import org.jboss.classloader.spi.ClassLoaderSystem; import org.jboss.classloading.spi.dependency.ClassLoading; import org.jboss.classloading.spi.dependency.Module; @@ -136,8 +137,22 @@ ClassLoader classLoader = unit.getClassLoader(); try { - // Remove the classloader - system.unregisterClassLoader(classLoader); + try + { + // Remove the classloader + system.unregisterClassLoader(classLoader); + } + finally + { + // Try to tidy up empty domains + String domainName = module.getDeterminedDomainName(); + if (ClassLoaderSystem.DEFAULT_DOMAIN_NAME.equals(domainName) == false) + { + ClassLoaderDomain domain = system.getDomain(domainName); + if (domain.hasClassLoaders() == false) + system.unregisterDomain(domain); + } + } } finally {
-
3. Re: JBAS-5376: leak of webapp classloader when deployed in e
brian.stansberry Apr 7, 2008 1:06 PM (in response to brian.stansberry)I'll let you know. Urgent thing for me is I'm trying to sort out classloading related failures in the FIELD granularity web session replication tests; first step was analyzing ClassLoaderLeakUnitTestCase failures, which is what led to my filing the JIRA. But this ear issue was really a tangent; the FIELD tests don't even use an ear.
The FIELD tests just use a war, but it declares a loader-repository. I'll see if it could somehow be related and post back one way or another. -
4. Re: JBAS-5376: leak of webapp classloader when deployed in e
brian.stansberry Apr 7, 2008 2:47 PM (in response to brian.stansberry)If you deploy a war with a loader-repository configured, the domain gets leaked; your patch above will fix that. But, in this case it's not such a big deal, as the war's classloader gets removed from the leaked domain, and the leaked domain's parent is the default domain. So, my FIELD granularity classloader leak problem is something else.