On Thu, 2004-11-18 at 07:09, Neelam Bhatnagar wrote:
> Hello all, 
> We have been using Lucene 3.1 version with Tomcat 4.0 and jdk1.4. 
> It seems that sometimes we see a "Too many files open" exception which
> completely garbles the whole index and whole search functionality
> crashes on the web site. It has also been known to crash the complete
> JSP container of tomcat. 

(I'm assuming you meant Lucene 1.3)

This exception happens when your process has too many file handles open.
Values differ by operating system.

With Lucene, this is caused by having a number of IndexReaders open.
Each IndexReader will open each file in your index. If you do not close
your IndexReaders, this exception can happen, especially if you have a
lot of heap and the IndexReaders are not getting garbage collected.

My guess is that you are creating a new IndexSearcher for each search
request and then not closing it after the search is complete. 

Lucene 1.3 added a feature called compound index files that much
alleviates this problem by greatly reducing the number of files required
in an index. You can use it by turning on IndexWriter.useCompoundFile(
true ):


Combined with closing your IndexReaders, this should fix the problem.

Luke Francl

To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to