Return-Path: Delivered-To: apmail-commons-issues-archive@minotaur.apache.org Received: (qmail 59892 invoked from network); 1 Feb 2011 08:38:24 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 1 Feb 2011 08:38:24 -0000 Received: (qmail 61885 invoked by uid 500); 1 Feb 2011 08:38:24 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 61505 invoked by uid 500); 1 Feb 2011 08:38:20 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 61487 invoked by uid 99); 1 Feb 2011 08:38:19 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 01 Feb 2011 08:38:19 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 01 Feb 2011 08:38:19 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 0C38218500A for ; Tue, 1 Feb 2011 08:37:29 +0000 (UTC) Date: Tue, 1 Feb 2011 08:37:29 +0000 (UTC) From: "Bernhard Reichl (JIRA)" To: issues@commons.apache.org Message-ID: <1220397925.1871.1296549449046.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] Commented: (VFS-309) ThreadLocal memory leak in DefaultFileContent 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/VFS-309?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12989095#comment-12989095 ] Bernhard Reichl commented on VFS-309: ------------------------------------- In the case of getting a zip file the workaround with DefaultFileContent.close() does not work as for all files within the zip file the ThreadLocal object is still valid and will not deleted by gc. > ThreadLocal memory leak in DefaultFileContent > --------------------------------------------- > > Key: VFS-309 > URL: https://issues.apache.org/jira/browse/VFS-309 > Project: Commons VFS > Issue Type: Bug > Affects Versions: 2.0 > Environment: Tomcat servlet container > Reporter: jontro > > When using commons vfs in a servlet container the ThreadLocal values stored will not be released once the request finishes. > There needs to be a method to clear these values otherwise the data will leak into the next request. > This was detected with tomcat 6.0.26. Upon undeploying an app that uses commons vfs tomcat detects the leaks with a huge amount of the following messages: > A web application created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@52fb241d]) and a value of type [org.apache.commons.vfs.provider.FileContentThreadData] (value [org.apache.commons.vfs.provider.FileContentThreadData@6600167a]) but failed to remove it when the web application was stopped. To prevent a memory leak, the ThreadLocal has been forcibly removed. -- This message is automatically generated by JIRA. - For more information on JIRA, see: http://www.atlassian.com/software/jira