Uploaded image for project: 'Felix'
  1. Felix
  2. FELIX-1170

MemoryLeak when stopping and restarting Felix

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • framework-1.2.1
    • framework-2.0.0
    • Framework
    • None
    • Atlassian JIRA

    Description

      There is a memory leak caused by a strong reference from the BundleProtectionDomain to a bundle and Felix.

      The problem is that a URLClassLoader gets its AccessControlContext from the stack - AccessController.getContext() calls AccessController.getStackAccessControlContext() which is basically arbitrary at the time.

      In our case we have a ServletFilter plugin that is being loaded by Felix. When a JasperLoader (a URLClassLoader) is created to load a JSP it inherits the BundleProtectionDomain as part of its AccessControlContext. If we later shut down Felix, it cannot be GC'd due to this reference.

      For our purposes we have tested making the m_felix and m_bundle weak references and have verified that it does indeed fix the problem.

      Attachments

        Activity

          People

            karlpauls Karl Pauls
            jedws Jed Wesley-Smith
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: