Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 94730 invoked from network); 9 Jul 2008 22:16:13 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 9 Jul 2008 22:16:13 -0000 Received: (qmail 30636 invoked by uid 500); 9 Jul 2008 22:16:12 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 30609 invoked by uid 500); 9 Jul 2008 22:16:12 -0000 Mailing-List: contact derby-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: Delivered-To: mailing list derby-dev@db.apache.org Received: (qmail 30598 invoked by uid 99); 9 Jul 2008 22:16:12 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 09 Jul 2008 15:16:12 -0700 X-ASF-Spam-Status: No, hits=-1999.8 required=10.0 tests=ALL_TRUSTED,WHOIS_MYPRIVREG X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 09 Jul 2008 22:15:21 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 314B0234C160 for ; Wed, 9 Jul 2008 15:15:44 -0700 (PDT) Message-ID: <1109292415.1215641744200.JavaMail.jira@brutus> Date: Wed, 9 Jul 2008 15:15:44 -0700 (PDT) From: "Brett Kail (JIRA)" To: derby-dev@db.apache.org Subject: [jira] Commented: (DERBY-3745) Derby can leak classloaders in an app server environment In-Reply-To: <2031389788.1214868646604.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/DERBY-3745?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12612304#action_12612304 ] Brett Kail commented on DERBY-3745: ----------------------------------- If code is creating a background Thread for its own purposes, then it needs to ensure that it does not hold on to an application class loader. This is true for any code intended to run in an application server environment. If the driver is unloaded, then Derby did seem to properly stop threads in the testcase I looked at. However, in an application server environment, the Derby driver cannot be unloaded when a single application is stopped since there can be many applications running that all depend on Derby. > Derby can leak classloaders in an app server environment > -------------------------------------------------------- > > Key: DERBY-3745 > URL: https://issues.apache.org/jira/browse/DERBY-3745 > Project: Derby > Issue Type: Bug > Components: Services > Affects Versions: 10.3.3.0, 10.4.1.3, 10.5.0.0 > Reporter: Kathey Marsden > Assignee: Kathey Marsden > Attachments: derby-3745_10.3_diff.txt, derby-3745_10.3_diff2.txt > > > A user reported potential class loader leaks in Derby > ...The first one looks like Derby created a long-running > thread and copying the context class loader. To fix, the > context class loader should be saved/set/restored around the > creation of the new thread so that it copies some benign class > loader instead (e.g., null or getClass().getClassLoader()): > 0x42278e58 java/lang/Thread@302e302e > [truncating at running thread LEAK] > Object: 0x42278e58 java/lang/Thread@302e302e > Children: > 0x42278ee0 java/lang/String@303f303f > 0x4226e558 java/lang/ThreadGroup@6f2e6f2e > 0x42278e40 > org/apache/derby/impl/services/monitor/AntiGC@603a603a > 0x419cfac0 > The second is another long running thread. The same applies: > 0x426fe7a0 java/lang/Thread@19901990 > [truncating at running thread LEAK] > Object: 0x426fe7a0 java/lang/Thread@19901990 > Parents: > 0x4226e5a8 [Ljava/lang/Thread;@6f386f38 > 0x426fe548 > org/apache/derby/iapi/services/context/ContextManager@19421942 > Children: > 0x426fe838 java/lang/String@19a319a3 > 0x4226e558 java/lang/ThreadGroup@6f2e6f2e > 0x426fe4f8 > org/apache/derby/impl/services/daemon/BasicDaemon@19381938 > 0x419cfac0 > The third is a TimerThread owneed , which is created when a > Timer is created. The same applies: > 0x425ac538 java/util/Timer$TimerImpl@6b8a6b8a > [truncating at running thread LEAK] > Object: 0x425ac538 java/util/Timer$TimerImpl@6b8a6b8a > Parents: > 0x41faaf58 [Ljava/lang/Thread;@3c583c58 > Object: 0x425ac510 java/util/Timer@6b856b85 > Parents: > 0x425ac500 > org/apache/derby/impl/services/timer/SingletonTimerFactory@56e25 > 6e2 > For more info, see thread at: > http://www.nabble.com/ClassLoader-leaks--td18121374.html -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.