Geronimo
  1. Geronimo
  2. GERONIMO-2885

JSF is leaking application ClassLoaders

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0-M3, 2.0-M5
    • Fix Version/s: 2.0, Verification Required
    • Component/s: Jetty, Tomcat
    • Security Level: public (Regular issues)
    • Labels:
      None

      Description

      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.

        Activity

        Hide
        Paul McMahan added a comment -

        Kevan I think this is fixed now, correct?

        Show
        Paul McMahan added a comment - Kevan I think this is fixed now, correct?
        Hide
        Alexei Novikov added a comment - - edited

        Please note that calling FactoryFinder.releaseFactories() does not release ClassLoaders due to this issue: http://issues.apache.org/jira/browse/MYFACES-1558

        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();
        _factories.remove(classLoader);
        _registeredFactoryNames.remove(classLoader);
        }

        ... and observed that the memory leak disappeared.

        Show
        Alexei Novikov added a comment - - edited Please note that calling FactoryFinder.releaseFactories() does not release ClassLoaders due to this issue: http://issues.apache.org/jira/browse/MYFACES-1558 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(); _factories.remove(classLoader); _registeredFactoryNames.remove(classLoader); } ... and observed that the memory leak disappeared.
        Hide
        David Jencks added a comment -

        This is fixed by now, isn't it?

        Show
        David Jencks added a comment - This is fixed by now, isn't it?
        Hide
        Kevan Miller added a comment -

        Was fixed a long time ago...

        Show
        Kevan Miller added a comment - Was fixed a long time ago...

          People

          • Assignee:
            Kevan Miller
            Reporter:
            Kevan Miller
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development