Return-Path: Delivered-To: apmail-lucene-java-dev-archive@www.apache.org Received: (qmail 42264 invoked from network); 22 Feb 2008 10:57:04 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 22 Feb 2008 10:57:04 -0000 Received: (qmail 3053 invoked by uid 500); 22 Feb 2008 10:56:53 -0000 Delivered-To: apmail-lucene-java-dev-archive@lucene.apache.org Received: (qmail 3004 invoked by uid 500); 22 Feb 2008 10:56:53 -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 2970 invoked by uid 99); 22 Feb 2008 10:56:53 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 22 Feb 2008 02:56:53 -0800 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED 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; Fri, 22 Feb 2008 10:56:28 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id ADD00234C04D for ; Fri, 22 Feb 2008 02:56:19 -0800 (PST) Message-ID: <210251569.1203677779693.JavaMail.jira@brutus> Date: Fri, 22 Feb 2008 02:56:19 -0800 (PST) From: =?utf-8?Q?Christian_Kohlsch=C3=BCtter_=28JIRA=29?= To: java-dev@lucene.apache.org Subject: [jira] Updated: (LUCENE-1186) [PATCH] Clear ThreadLocal instances in close() In-Reply-To: <873669842.1203677779340.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/LUCENE-1186?page=3Dcom.atlassi= an.jira.plugin.system.issuetabpanels:all-tabpanel ] Christian Kohlsch=C3=BCtter updated LUCENE-1186: ------------------------------------------- Attachment: LUCENE-1186-SegmentReader.patch Patch: Adds termVectorsLocal.set(null) to SegmentReader#close() > [PATCH] Clear ThreadLocal instances in close() > ---------------------------------------------- > > Key: LUCENE-1186 > URL: https://issues.apache.org/jira/browse/LUCENE-1186 > Project: Lucene - Java > Issue Type: Improvement > Affects Versions: 2.3, 2.3.1, 2.4 > Environment: any > Reporter: Christian Kohlsch=C3=BCtter > Priority: Minor > Attachments: LUCENE-1186-SegmentReader.patch > > > As already found out in LUCENE-436, there seems to be a garbage collectio= n problem with ThreadLocals at certain constellations, resulting in an OutO= fMemoryError. > The resolution there was to remove the reference to the ThreadLocal value= when calling the close() method of the affected classes (see FieldsReader = and TermInfosReader). > For Java < 5.0, this can effectively be done by calling threadLocal.set(n= ull); for Java >=3D 5.0, we would call threadLocal.remove() > Analogously, this should be done in *any* class which creates ThreadLocal= values > Right now, two classes of the core API make use of ThreadLocals, but do n= ot properly remove their references to the ThreadLocal value > 1. org.apache.lucene.index.SegmentReader > 2. org.apache.lucene.analysis.Analyzer > For SegmentReader, I have attached a simple patch. > For Analyzer, there currently is no patch because Analyzer does not provi= de a close() method (future to-do?) --=20 This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. --------------------------------------------------------------------- To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org For additional commands, e-mail: java-dev-help@lucene.apache.org