lucene-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From shaoxianyang <ysxsu...@hotmail.com>
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.

Thanks.



Shaoxian Yang

-- 
View this message in context: http://www.nabble.com/IndexSearcher-close%28%29-and-search%28%29-called-concurrently-by-different-threads--tp25667782p25672303.html
Sent from the Lucene - General mailing list archive at Nabble.com.


Mime
View raw message