Return-Path: Delivered-To: apmail-jakarta-lucene-user-archive@www.apache.org Received: (qmail 63344 invoked from network); 15 Nov 2004 17:19:17 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 15 Nov 2004 17:19:17 -0000 Received: (qmail 71306 invoked by uid 500); 15 Nov 2004 17:19:12 -0000 Delivered-To: apmail-jakarta-lucene-user-archive@jakarta.apache.org Received: (qmail 71286 invoked by uid 500); 15 Nov 2004 17:19:11 -0000 Mailing-List: contact lucene-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Lucene Users List" Reply-To: "Lucene Users List" Delivered-To: mailing list lucene-user@jakarta.apache.org Received: (qmail 71273 invoked by uid 99); 15 Nov 2004 17:19:11 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: local policy) Received: from [12.40.185.2] (HELO mspmail2.stellent.com) (12.40.185.2) by apache.org (qpsmtpd/0.28) with ESMTP; Mon, 15 Nov 2004 09:19:08 -0800 Received: from [10.10.20.20] ([10.10.20.20]) by mspmail2.stellent.com (8.11.6+Sun/8.11.5) with ESMTP id iAFHJ4J20601 for ; Mon, 15 Nov 2004 11:19:04 -0600 (CST) Subject: Re: Index File From: Luke Francl To: Lucene Users List In-Reply-To: <07d201c4cb35$c1658e60$7703d00a@hypermedia.com> References: <000901c4c91d$1a4fabc0$0a00a8c0@supportsit.local> <1100533162.2886.60.camel@localhost> <07a701c4cb2b$1238c880$7703d00a@hypermedia.com> <1100534580.2886.67.camel@localhost> <07d201c4cb35$c1658e60$7703d00a@hypermedia.com> Content-Type: text/plain Message-Id: <1100539133.2886.75.camel@localhost> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.6 Date: Mon, 15 Nov 2004 11:18:54 -0600 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N As long as you are closing your IndexSearchers when you are done with them you should not have problems with file handles. When using Lucene 1.2 (pre-compound file format) on Windows, I ran into this problem because Windows only lets an application open something like 1000 file handles. On Unix the number is larger. To calculate the cost of creating a new IndexSearcher for each search, just put a timing statement around your call to IndexSearcher.open and IndexSearcher.close. Your performance cost is the time used when opening and closing unnecessarily. Here is a description of the scheme I used to manage this issue: "Creating a new IndexSearcher for every request opens too many files. Searchers are thread-safe, so it is good to keep only one Searcher open at a time. However, we must create a new Searcher if the index has changed, and it is not safe to close a Searcher while it is still in use by a thread. The SearcherManager handles these cases. The SearcherManager keeps a list of the Searchers which are currently in use and returns the the current one, or a new one if necessary. The SearcherManager uses a reference counting scheme to keep track of which Searchers are still being used. Callers must return their Searcher to the SearcherManager when done using it so the Searcher can be closed (releasing its filehandles) if no other threads are using it and the index has changed." --------------------------------------------------------------------- To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: lucene-user-help@jakarta.apache.org