Uploaded image for project: 'WildFly'
  1. WildFly
  2. WFLY-967

ClassLoader memory leak with JSF

    XMLWordPrintable

Details

    • Bug
    • Resolution: Obsolete
    • Critical
    • None
    • None
    • JSF
    • None
    • Workaround Exists
    • Hide

      Use ServletContextListener to call java.beans.Introspector.flushCaches() in contextDestroyed.

      Show
      Use ServletContextListener to call java.beans.Introspector.flushCaches() in contextDestroyed.

    Description

      JSF application's classes are not unloaded properly when undeployed. The test case is in the attachment. Steps to reproduce:

      1. mvn package
      2. deploy war-leak.war
      3. open http://localhost:8080/war-leak
      4. undeploy war-leak.war
      5. analyze a heap dump to find unloaded ModuleClassLoader of war-leak.war

      References to the WAR classes are hold by java.beans.Introspector caches. It seems to be a known bug (feature?). For example Tomcat automatically invokes java.beans.Introspector.flushCaches() when WAR undeploys. There is also IntrospectorCleanupListener in Spring for the same purpose.

      http://wiki.apache.org/commons/Logging/UndeployMemoryLeak
      http://static.springsource.org/spring/docs/2.5.x/api/org/springframework/web/util/IntrospectorCleanupListener.html

      Attachments

        Issue Links

          Activity

            People

              ssilvert@redhat.com Stan Silvert
              pref_jira Vlad Arkhipov (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: