Return-Path: Delivered-To: apmail-lucene-java-dev-archive@www.apache.org Received: (qmail 44957 invoked from network); 19 Dec 2006 19:50:38 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 19 Dec 2006 19:50:38 -0000 Received: (qmail 29878 invoked by uid 500); 19 Dec 2006 19:50:38 -0000 Delivered-To: apmail-lucene-java-dev-archive@lucene.apache.org Received: (qmail 29828 invoked by uid 500); 19 Dec 2006 19:50:38 -0000 Mailing-List: contact java-dev-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: java-dev@lucene.apache.org Delivered-To: mailing list java-dev@lucene.apache.org Received: (qmail 29801 invoked by uid 99); 19 Dec 2006 19:50:38 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 19 Dec 2006 11:50:38 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: neutral (herse.apache.org: local policy) Received: from [169.229.70.167] (HELO rescomp.berkeley.edu) (169.229.70.167) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 19 Dec 2006 11:50:28 -0800 Received: by rescomp.berkeley.edu (Postfix, from userid 1007) id CAAF85B763; Tue, 19 Dec 2006 11:50:07 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by rescomp.berkeley.edu (Postfix) with ESMTP id C2CB47F403 for ; Tue, 19 Dec 2006 11:50:07 -0800 (PST) Date: Tue, 19 Dec 2006 11:50:07 -0800 (PST) From: Chris Hostetter To: java-dev@lucene.apache.org Subject: Re: ThreadLocal leak (was Re: Leaking org.apache.lucene.index.* objects) In-Reply-To: <20061219192236.90542.qmail@web50314.mail.yahoo.com> Message-ID: References: <20061219192236.90542.qmail@web50314.mail.yahoo.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Checked: Checked by ClamAV on apache.org : Can anyone else have a look at the patch for LUCENE-651 (or just at : FieldCacheImpl) and see if there is a quick fix? If i'm not mistaken, isn't line #65 wrong? ... synchronized (readerCache) { innerCache = (Map) readerCache.get(reader); if (innerCache == null) { innerCache = new HashMap(); readerCache.put(reader, innerCache); value = null; } else { value = innerCache.get(key); } if (value == null) { value = new CreationPlaceholder(); innerCache.put(reader, value); <--- L65 } } ...why is the reader being used as the key of the innerCache? Shouldn't the "key" (param) be used here? ... nothing seems to ever remove the reader from the innerCache, so i don't see how the WeekHashMap readerCache would ever let go of it either. : Also, wouldn't it be better if IndexReaders had a reference to their : copy FieldCache, which they can kill when they are closed? What we have : now is a chunky FieldCacheImpl that has references to IndexReaders, and : doesn't know when they are closed, and thus it can't remove them and : their data from its internal caches? as i recall, we've discussed that on the mailing list as being a "better API" for dealing with FieldCaches ... but it would be an API changes, and no one has (as of yet) attempted it and submitted a patch. -Hoss --------------------------------------------------------------------- To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org For additional commands, e-mail: java-dev-help@lucene.apache.org