[weld-issues] [JBoss JIRA] Created: (WELD-787) CurrentInjectionPoint ThreadLocal leak with Weld Servlet

Aslak Knutsen (JIRA) jira-events at lists.jboss.org
Mon Dec 13 11:23:54 EST 2010


CurrentInjectionPoint ThreadLocal leak with Weld Servlet
--------------------------------------------------------

                 Key: WELD-787
                 URL: https://issues.jboss.org/browse/WELD-787
             Project: Weld
          Issue Type: Bug
          Components: Servlet Container Support
    Affects Versions: 1.1.0.Beta2
         Environment: Weld Servlet 1.1.0-SNAPSHOT / Beta2 / Beta1 on Tomcat 6 
            Reporter: Aslak Knutsen


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 at 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.



-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the weld-issues mailing list