geronimo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alexei Novikov (JIRA)" <>
Subject [jira] Commented: (GERONIMO-2885) JSF is leaking application ClassLoaders
Date Fri, 13 Jul 2007 17:52:05 GMT


Alexei Novikov commented on GERONIMO-2885:

Please note that calling FactoryFinder.releaseFactories() does not release ClassLoaders due
to this issue:

There are two static hash maps that hold ClassLoaders instances: *_factories* and *_registeredFactoryNames*.

*releaseFactories()* removes ClassLoaders entries only from *_factories* and leaves them intact
in *_registeredFactoryNames*, which is enough to prevent them from being GC'ed.

At the time of this comment being written, this bug was not resolved, but I patched FactoryFinder
locally with the line of code marked red:

    public static void releaseFactories()
            throws FacesException
        ClassLoader classLoader = getClassLoader();
       {color:red}  _registeredFactoryNames.remove(classLoader);{color} 

... and observed that the memory leak disappears.

> JSF is leaking application ClassLoaders
> ---------------------------------------
>                 Key: GERONIMO-2885
>                 URL:
>             Project: Geronimo
>          Issue Type: Bug
>      Security Level: public(Regular issues) 
>          Components: Jetty, Tomcat
>    Affects Versions: 2.0-M3, 2.0-M5
>            Reporter: Kevan Miller
>             Fix For: 2.0-M5
> javax.faces.FactoryFinder is holding onto application ClassLoaders. This prevents the
ClassLoaders from being GC'ed after an undeploy.
> Need to call FactoryFinder.releaseFactories() during undeploy. This will release the
current ContextClassLoader.

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message