[picocontainer-scm] [jira] (PICO-389) Various ThreadLocal memory leaks

"Johann Burkard (JIRA)" <jira-yCVjj/[email protected]> Tue, 31 Jul 2012 12:58:22 -0500 (CDT)
Newsgroups gmane.comp.java.picocontainer.cvs
Message-ID <812785451.34315.1343757503220.JavaMail.j2ee-jira@codehaus01.managed.contegix.com>
Johann Burkard
created PICO-389

Various ThreadLocal memory leaks

Issue Type:

Bug

Affects Versions:

2.14.1

Assignee:

Paul Hammant

Components:

Pico Web Remoting, PicoContainer (Java)

Created:

31/Jul/12 12:57 PM

Description:

There are a number of ThreadLocals in PicoContainer and PWR that are not correctly disposed of.

DefaultPicoContainer#dispose should call

intoThreadLocal.remove();
intoThreadLocal = null;

DefaultPicoContainer#getComponent(Object, Type) should call

} finally {
intoThreadLocal.set(null);
intoThreadLocal.remove();
}

PicoServletContainerListener#contextDestroyed doesn't remove the ScopedContainers instance from the servlet context:

public void contextDestroyed(ServletContextEvent event) {
ScopedContainers scopedContainers = getScopedContainers(event.getServletContext());
stop(scopedContainers.getApplicationContainer());
dispose(scopedContainers.getApplicationContainer());
}

Storing#mapThreadLocalObjectReference should not be final and should be nulled by PicoServletContainerListener#contextDestroyed.

I think that should help with the errors logged by Tomcat.

Project:

PicoContainer

Priority:

Major

Reporter:

Johann Burkard

This message is automatically generated by JIRA.

If you think it was sent incorrectly, please contact your JIRA administrators .

For more information on JIRA, see: http://www.atlassian.com/software/jira

----------

To unsubscribe from this list please visit:

http://xircles.codehaus.org/manage_email