Uploaded image for project: 'Weld'
  1. Weld
  2. WELD-787

CurrentInjectionPoint ThreadLocal leak with Weld Servlet

    XMLWordPrintable

Details

    Description

      Nov 22, 2010 7:13:40 PM org.apache.catalina.loader.WebappClassLoader clearThreadLocalMap
      SEVERE: The web application [/active1] created a ThreadLocal with key of type [null] (value [org.jboss.weld.injection.CurrentInjectionPoint$1@30b95f2]) and a value of type [java.util.Stack] (value [[]]) but failed to remove it when the web application was stopped. This is very likely to create a memory leak.

      The CurrentInjectionPoint push/pop works, since the Stack object on the Thread is Empty when undeploy.

      CurrentInjectionPoint.cleanup is called during the contextDestroyed lifecycle, but the event is executed on the main Thread, not the HTTP thread. This results in the Empty Stack leak.

      ThreadLocals active during a HTTP request has to be cleaned up at the end of the Request. There are no guarantees that you will ever see that Thread again. CurrentInjectionPoint.cleanup should probably be moved to the requestDestroyed lifecycle.

      Attachments

        Activity

          People

            pmuiratbleepbleep Pete Muir (Inactive)
            aslak@redhat.com Aslak Knutsen
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: