Return-Path: X-Original-To: apmail-struts-issues-archive@minotaur.apache.org Delivered-To: apmail-struts-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 1ECB6F0C1 for ; Fri, 26 Apr 2013 06:26:17 +0000 (UTC) Received: (qmail 27006 invoked by uid 500); 26 Apr 2013 06:26:16 -0000 Delivered-To: apmail-struts-issues-archive@struts.apache.org Received: (qmail 26979 invoked by uid 500); 26 Apr 2013 06:26:16 -0000 Mailing-List: contact issues-help@struts.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@struts.apache.org Delivered-To: mailing list issues@struts.apache.org Received: (qmail 26938 invoked by uid 99); 26 Apr 2013 06:26:15 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 26 Apr 2013 06:26:15 +0000 Date: Fri, 26 Apr 2013 06:26:15 +0000 (UTC) From: "Lukasz Lenart (JIRA)" To: issues@struts.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (WW-4058) ContainerHolder causes ThreadLocal memory leak MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/WW-4058?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13642631#comment-13642631 ] Lukasz Lenart commented on WW-4058: ----------------------------------- Added a new method to cleanup Dispatcher after initialisation that should solve the problem. [~bmorris591] could you re-test with the latest build? But please wait for Hudson, it can take some time to build a package and publish it. > ContainerHolder causes ThreadLocal memory leak > ---------------------------------------------- > > Key: WW-4058 > URL: https://issues.apache.org/jira/browse/WW-4058 > Project: Struts 2 > Issue Type: Bug > Components: Core Actions > Affects Versions: 2.3.14 > Environment: Tomcat 7.0.39 > java version "1.7.0_15" > OpenJDK Runtime Environment (IcedTea7 2.3.7) (7u15-2.3.7-0ubuntu1~12.04.1) > OpenJDK 64-Bit Server VM (build 23.7-b01, mixed mode) > Reporter: Boris Morris > Assignee: Lukasz Lenart > Fix For: 2.3.15 > > Attachments: hprof_2.png, hprof.png > > > The localContext ThreadLocal is not cleaned up properly when stopping / undeploying / redeploying a S2 application. This will in most cases cause the web application ClassLoader not to be garbage collected, thus leaving a redeployment memory leak. > I am using Tomcat 7.0.39 and when I undeploy my application the following is reported in the logs: > {noformat} > 2013-04-23 12:00:31,082 [request-worker-4] ERROR org.apache.catalina.loader.WebappClassLoader- The web application [/dev] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@7f2283e1]) and a value of type [com.opensymphony.xwork2.inject.ContainerImpl] (value [com.opensymphony.xwork2.inject.ContainerImpl@330069fc]) 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. > 2013-04-23 12:00:31,083 [request-worker-4] ERROR org.apache.catalina.loader.WebappClassLoader- The web application [/dev] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@7f2283e1]) and a value of type [com.opensymphony.xwork2.inject.ContainerImpl] (value [com.opensymphony.xwork2.inject.ContainerImpl@330069fc]) 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. > 2013-04-23 12:00:31,101 [request-worker-4] ERROR org.apache.catalina.loader.WebappClassLoader- The web application [/dev] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@7f2283e1]) and a value of type [com.opensymphony.xwork2.inject.ContainerImpl] (value [com.opensymphony.xwork2.inject.ContainerImpl@330069fc]) 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. > 2013-04-23 12:00:31,101 [request-worker-4] ERROR org.apache.catalina.loader.WebappClassLoader- The web application [/dev] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@7f2283e1]) and a value of type [com.opensymphony.xwork2.inject.ContainerImpl] (value [com.opensymphony.xwork2.inject.ContainerImpl@330069fc]) 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. > 2013-04-23 12:00:31,101 [request-worker-4] ERROR org.apache.catalina.loader.WebappClassLoader- The web application [/dev] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@7f2283e1]) and a value of type [com.opensymphony.xwork2.inject.ContainerImpl] (value [com.opensymphony.xwork2.inject.ContainerImpl@330069fc]) 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. > 2013-04-23 12:00:31,101 [request-worker-4] ERROR org.apache.catalina.loader.WebappClassLoader- The web application [/dev] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@7f2283e1]) and a value of type [com.opensymphony.xwork2.inject.ContainerImpl] (value [com.opensymphony.xwork2.inject.ContainerImpl@330069fc]) 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. > 2013-04-23 12:00:31,102 [request-worker-4] ERROR org.apache.catalina.loader.WebappClassLoader- The web application [/dev] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@7f2283e1]) and a value of type [com.opensymphony.xwork2.inject.ContainerImpl] (value [com.opensymphony.xwork2.inject.ContainerImpl@330069fc]) 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. > 2013-04-23 12:00:31,102 [request-worker-4] ERROR org.apache.catalina.loader.WebappClassLoader- The web application [/dev] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@7f2283e1]) and a value of type [com.opensymphony.xwork2.inject.ContainerImpl] (value [com.opensymphony.xwork2.inject.ContainerImpl@330069fc]) 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. > 2013-04-23 12:00:31,103 [request-worker-4] ERROR org.apache.catalina.loader.WebappClassLoader- The web application [/dev] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@7f2283e1]) and a value of type [com.opensymphony.xwork2.inject.ContainerImpl] (value [com.opensymphony.xwork2.inject.ContainerImpl@330069fc]) 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. > 2013-04-23 12:00:31,103 [request-worker-4] ERROR org.apache.catalina.loader.WebappClassLoader- The web application [/dev] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@7f2283e1]) and a value of type [com.opensymphony.xwork2.inject.ContainerImpl] (value [com.opensymphony.xwork2.inject.ContainerImpl@330069fc]) 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. > 2013-04-23 12:00:31,103 [request-worker-4] ERROR org.apache.catalina.loader.WebappClassLoader- The web application [/dev] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@7f2283e1]) and a value of type [com.opensymphony.xwork2.inject.ContainerImpl] (value [com.opensymphony.xwork2.inject.ContainerImpl@330069fc]) 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. > 2013-04-23 12:00:31,103 [request-worker-4] ERROR org.apache.catalina.loader.WebappClassLoader- The web application [/dev] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@7f2283e1]) and a value of type [com.opensymphony.xwork2.inject.ContainerImpl] (value [com.opensymphony.xwork2.inject.ContainerImpl@330069fc]) 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. > {noformat} > After poking around in the heap dump it would seem that Tomcat is correct. There is indeed a GC root at the ThreadLocal used by the ContainerImpl. -- 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