Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-15955

Empty Stack left in each Thread which executed a Display Macro

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Minor
    • 10.11-rc-1
    • 7.4-milestone-1
    • Display
    • None
    • Unknown
    • N/A
    • N/A

    Description

      Bug/Regression introduced in https://github.com/xwiki/xwiki-platform/commit/210bf94fa6ecd8eaa7a12f60ae0d1892d2946837

      The code is missing a dispose() method to remove the ThreadLocal.

      Otherwise this will lead to a memory leak. Tomcat warns us about this. For example:

      01-Mar-2018 13:48:01.890 SEVERE [Thread-10] org.apache.catalina.loader.WebappClassLoaderBase.checkThreadLocalMapForLeaks The web application [xwiki] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@5d6ebdd6]) and a value of type [org.codehaus.plexus.classworlds.realm.ClassRealm] (value [ClassRealm[plexus.core, parent: null]]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak
      

      See also XWIKI-9055

      Attachments

        Issue Links

          Activity

            People

              tmortagne Thomas Mortagne
              vmassol Vincent Massol
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: