Return-Path: Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: (qmail 29804 invoked from network); 2 Dec 2009 17:44:37 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 2 Dec 2009 17:44:37 -0000 Received: (qmail 54658 invoked by uid 500); 2 Dec 2009 17:44:35 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 54573 invoked by uid 500); 2 Dec 2009 17:44:35 -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 54563 invoked by uid 99); 2 Dec 2009 17:44:35 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 02 Dec 2009 17:44:35 +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: domain of eirbjo@gmail.com designates 209.85.220.228 as permitted sender) Received: from [209.85.220.228] (HELO mail-fx0-f228.google.com) (209.85.220.228) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 02 Dec 2009 17:44:25 +0000 Received: by fxm28 with SMTP id 28so511671fxm.5 for ; Wed, 02 Dec 2009 09:44:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=/vomy9pAWEFHY3Z8go6TcWI2OXSTdkzaPEgKr15tyIs=; b=pYr4X6XYOBsm66g+S0jPdZTkr2djUzPr48pbpfEYBp+YaYJaMN/lFSUZ4NF2aR/pbV k0sbTSMtgjwiNsqeqcsNgDzK/WpYZ6TRgnvzHMLn/vp+BNwrMgQcDo1gLEC7kpN07Hp1 qaXL8RPegZAoVsvpZtDSW5A+Qi1GqYuJQuafU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=BrdT++cHazub/0i5QmoFTAln5xBQdsmsKJroEZ8r2GMjKm/v0dlPyvSJMu7rp6ZDT8 XJ8Au6yyzx7EFbPY4hMzsGctoVXB2FfeMAAhXeVwlXIaTl6XZM2JfJy/2sdh6ftEBFvO Wves8g7y/uR3nC/U7OBrfWFvk6ix1VbG+aldM= MIME-Version: 1.0 Received: by 10.216.86.85 with SMTP id v63mr136617wee.32.1259775845227; Wed, 02 Dec 2009 09:44:05 -0800 (PST) Date: Wed, 2 Dec 2009 18:44:05 +0100 Message-ID: <34660cca0912020944n2b6b7965i6753f1b47b8f4820@mail.gmail.com> Subject: Potential leak of file resources in SpellChecker From: =?ISO-8859-1?Q?Eirik_Bj=F8rsn=F8s?= To: java-user@lucene.apache.org Content-Type: multipart/mixed; boundary=0016e6d9a057c05cf20479c26bd6 X-Virus-Checked: Checked by ClamAV on apache.org --0016e6d9a057c05cf20479c26bd6 Content-Type: text/plain; charset=ISO-8859-1 Hi, I'm using SpellChecker (in Lucene contrib) to help users of SVNSearch who can't type right: http://svnsearch.org/svnsearch/repos/ASF/search?logMessage=lusene SpellChecker works very well for my purpose, but I've encountered a possible file resource leak issue: I can't find any way to close the IndexSearcher (and IndexReader) that is being used by SpellChecker internally. I've worked around this issue by keeping a single SpellChecker open for each repository, but I'd really like to be able to close it and reopen it on demand without leaking file descriptors. Could we add a close() method to SpellChecker that will close the IndexSearcher and null the reference to it? And perhaps add some code that reopens the searcher if the reference to it is null? Or would that break thread safety of SpellChecker? The attached patch adds a close method but leaves it to the user to call setSpellIndex to reopen the searcher. Thanks, Eirik. --0016e6d9a057c05cf20479c26bd6 Content-Type: text/plain; charset=us-ascii --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org For additional commands, e-mail: java-user-help@lucene.apache.org --0016e6d9a057c05cf20479c26bd6--