To make a search by lucene we use Web application that is working in the servlet-container tomcat.

Periodically we update the search index by adding and removing some of the documents. To update the index we make the following actions:

1. Open the index
2. Add/delete documents
3. In case it is needed we optimize the index
4. Close the index

After the updates of search index were done we report the Web application that there are changes in the index. Web application does the following:

1. Close old index search object (before closing the application waits until all steams finish up the work with search index):
searcher.close()

2. Create new index search object - searcher:
File file = new File(pathToIndex);
IndexSearcher searcher = new IndexSearcher(NIOFSDirectory.open(file), true);

After a while, the Web application stops operating because of the error "Too many open files". If you look at a list of files that were opened by tomcat process (using the command "ls -la /proc/$PID/fd"), you can see that there are a lot of deleted ".cfs" files.

There are no errors in the tomcat logs.

Can you help us to figure out why this situation is occurred and how to solve it up?


Thanks in advance.

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org
For additional commands, e-mail: java-user-h...@lucene.apache.org

Reply via email to