Return-Path: Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: (qmail 49830 invoked from network); 30 Sep 2010 10:00:48 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 30 Sep 2010 10:00:48 -0000 Received: (qmail 92547 invoked by uid 500); 30 Sep 2010 10:00:47 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 92144 invoked by uid 500); 30 Sep 2010 10:00:44 -0000 Mailing-List: contact java-user-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: java-user@lucene.apache.org Delivered-To: mailing list java-user@lucene.apache.org Received: (qmail 92136 invoked by uid 99); 30 Sep 2010 10:00:43 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 30 Sep 2010 10:00:43 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [71.6.200.51] (HELO serve.stimulussoft.com) (71.6.200.51) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 30 Sep 2010 10:00:34 +0000 Received: from serve.stimulussoft.com (localhost.localdomain [127.0.0.1]) by serve.stimulussoft.com (Postfix) with ESMTP id A7D4710747 for ; Thu, 30 Sep 2010 03:00:12 -0700 (PDT) Received: by serve.stimulussoft.com (Postfix, from userid 5001) id 96A1E1078E; Thu, 30 Sep 2010 03:00:12 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.4 (2008-01-01) on serve.stimulussoft.com X-Spam-Level: Received: from Jamie-Bands-MacBook-Pro.local (196-210-169-220.dynamic.isadsl.co.za [196.210.169.220]) by serve.stimulussoft.com (Postfix) with ESMTPA id 91C1D10747 for ; Thu, 30 Sep 2010 03:00:10 -0700 (PDT) Message-ID: <4CA45F93.4000503@stimulussoft.com> Date: Thu, 30 Sep 2010 11:59:47 +0200 From: Jamie User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.9) Gecko/20100915 Thunderbird/3.1.4 MIME-Version: 1.0 To: java-user@lucene.apache.org Subject: Re: File Handle Leaks During Lucene 3.0.2 Merge References: <4CA37BD8.8050608@stimulussoft.com> <006d01cb6003$2f298650$8d7c92f0$@thetaphi.de> <4CA38A5F.1000100@stimulussoft.com> <000001cb607d$486b9660$d942c320$@thetaphi.de> <4CA457AE.8080203@stimulussoft.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV using ClamSMTP X-Virus-Checked: Checked by ClamAV on apache.org X-Old-Spam-Status: No, score=-4.5 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.4 Hi Michael / Uwe >It's good to cache the reader, but, finalize would worry me too since >you have no control over when GC gets around to calling it... you risk >tying up resources for longer than necessary. I did it this way, as I didn't want to over complicate the code by introducing mechanisms to track the number of search threads using a shared indexreader. Admittedly, its not a very clean solution but in my case it does work. Is there a particular technique for knowing when to a close a reader when there are multiple search threads using that reader? Should I keep some kind of counter and override the close method of the reader such that the underlying reader is only closed when everyone's done with it? > IndexWriter has a reader pool, internally, where it holds open > SegmentReaders for the still-live segments in the index. This is used > by IndexReader.reopen to share open SegmentReaders. > > But the open files should correspond only to segments still "live" in > the index. After segments are merged away, these readers are dropped. > Is this what you are seeing? > I dont fully understand your explanation/question. When I run lsof, I am seeing the following: /usr/local/mailarchiva/server/webapps/ROOT/WEB-INF/logs/index/_jyr.cfs (deleted) /usr/local/mailarchiva/server/webapps/ROOT/WEB-INF/logs/index/_jyp.cfs (deleted) I assume these are left by the OS after the merge operation tried to delete old segments. The OS is unable to delete the files. I think its because our new code never closes the indexwriter, but rather uses the indexwriter.commit() method to apply the changes. Is this correct? Jamie --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org For additional commands, e-mail: java-user-help@lucene.apache.org