Return-Path: Delivered-To: apmail-db-derby-commits-archive@www.apache.org Received: (qmail 30251 invoked from network); 21 Sep 2005 07:25:03 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 21 Sep 2005 07:25:03 -0000 Received: (qmail 74179 invoked by uid 500); 21 Sep 2005 07:25:03 -0000 Delivered-To: apmail-db-derby-commits-archive@db.apache.org Received: (qmail 74119 invoked by uid 500); 21 Sep 2005 07:25:03 -0000 Mailing-List: contact derby-commits-help@db.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: "Derby Development" List-Id: Delivered-To: mailing list derby-commits@db.apache.org Received: (qmail 74106 invoked by uid 99); 21 Sep 2005 07:25:02 -0000 X-ASF-Spam-Status: No, hits=-9.8 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [209.237.227.194] (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.29) with SMTP; Wed, 21 Sep 2005 00:25:02 -0700 Received: (qmail 30179 invoked by uid 65534); 21 Sep 2005 07:24:42 -0000 Message-ID: <20050921072442.30178.qmail@minotaur.apache.org> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r290644 - in /db/derby/code/trunk/java/engine/org/apache/derby: iapi/services/context/ContextService.java impl/services/monitor/BaseMonitor.java impl/services/monitor/FileMonitor.java Date: Wed, 21 Sep 2005 07:24:38 -0000 To: derby-commits@db.apache.org From: bernt@apache.org X-Mailer: svnmailer-1.0.5 X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: bernt Date: Wed Sep 21 00:24:21 2005 New Revision: 290644 URL: http://svn.apache.org/viewcvs?rev=290644&view=rev Log: DERBY-23: just booting jdbc driver and shutting down seem to leak memory. Fix by : Knut Anders Hatlen Modified: db/derby/code/trunk/java/engine/org/apache/derby/iapi/services/context/ContextService.java db/derby/code/trunk/java/engine/org/apache/derby/impl/services/monitor/BaseMonitor.java db/derby/code/trunk/java/engine/org/apache/derby/impl/services/monitor/FileMonitor.java Modified: db/derby/code/trunk/java/engine/org/apache/derby/iapi/services/context/ContextService.java URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/engine/org/apache/derby/iapi/services/context/ContextService.java?rev=290644&r1=290643&r2=290644&view=diff ============================================================================== --- db/derby/code/trunk/java/engine/org/apache/derby/iapi/services/context/ContextService.java (original) +++ db/derby/code/trunk/java/engine/org/apache/derby/iapi/services/context/ContextService.java Wed Sep 21 00:24:21 2005 @@ -94,9 +94,9 @@ STACK for last 3 */ - final ThreadLocal threadContextList = new ThreadLocal(); + private ThreadLocal threadContextList = new ThreadLocal(); - private final HashSet allContexts; + private HashSet allContexts; // don't want any instances public ContextService() { @@ -114,6 +114,12 @@ So it can be given to us and taken away... */ public static void stop() { + // For some unknown reason, the ContextManager and + // ContextService objects will not be garbage collected + // without the next two lines. + factory.allContexts = null; + factory.threadContextList = null; + ContextService.factory = null; } Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/services/monitor/BaseMonitor.java URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/engine/org/apache/derby/impl/services/monitor/BaseMonitor.java?rev=290644&r1=290643&r2=290644&view=diff ============================================================================== --- db/derby/code/trunk/java/engine/org/apache/derby/impl/services/monitor/BaseMonitor.java (original) +++ db/derby/code/trunk/java/engine/org/apache/derby/impl/services/monitor/BaseMonitor.java Wed Sep 21 00:24:21 2005 @@ -2184,9 +2184,6 @@ } public void run() { - - goAway = false; - while (true) { synchronized (this) { if (goAway) Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/services/monitor/FileMonitor.java URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/engine/org/apache/derby/impl/services/monitor/FileMonitor.java?rev=290644&r1=290643&r2=290644&view=diff ============================================================================== --- db/derby/code/trunk/java/engine/org/apache/derby/impl/services/monitor/FileMonitor.java (original) +++ db/derby/code/trunk/java/engine/org/apache/derby/impl/services/monitor/FileMonitor.java Wed Sep 21 00:24:21 2005 @@ -89,7 +89,12 @@ { if (!lite) { try { + // Create a ThreadGroup and set the daemon property to + // make sure the group is destroyed and garbage + // collected when all its members have finished (i.e., + // when the driver is unloaded). daemonGroup = new ThreadGroup("derby.daemons"); + daemonGroup.setDaemon(true); } catch (SecurityException se) { } }