lucene-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From shaoxianyang <>
Subject Re: IndexSearcher close() and search() called concurrently by different threads?
Date Tue, 29 Sep 2009 22:50:13 GMT

Hi Diego,

Thanks for reply.

I am not worrying about old indexSearcher will be GC (garbage collected)
eventually, since in my code, nothing will hold up to that reference.

The reason why I want to close the old searcher before I assign/instantiate
a new search, is because I want to make sure that I close the underlying
resource.  IndexSearcher.close() method exists for a reason.  I checked
lucene source code, it will close the underlying reader object.  If i don't
close it, i hope i don't leave the file descriptor open, and eventually run
out of file descriptors in system.

What do you think?  Feel free to contribute more thoughts.


Shaoxian Yang

View this message in context:
Sent from the Lucene - General mailing list archive at

View raw message