You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by Volodymyr Bychkoviak <vb...@i-hypergrid.com> on 2005/03/01 12:20:56 UTC

Is IndexSearcher thread safe?

Is it thread-safe to share one
instance of IndexSearcher between multiple threads?


---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-user-help@jakarta.apache.org


Re[2]: Is IndexSearcher thread safe?

Posted by Yura Smolsky <in...@altervision.biz>.
Hello, Volodymyr.

VB> Additional question.
VB> If I'm sharing one instance of IndexSearcher between different threads
VB> Is it good to just to drop this instance to GC.
VB> Because I don't know if some thread is still using this searcher or done
VB> with it.

It is safe to share one instance between many threads and it should be
safe to drop old object to GC.

But I have discovered one strange fact. When you have indexSearcher on
big index, so IndexSearcher object takes a lot of memory (900Mb) and
when you create new IndexSearcher after deletion of all references to
old IndexSearcher then memory consumed my old IndexSearcher will not be
ever freed.
What can community answer on this strange fact?

Yura Smolsky.



---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-user-help@jakarta.apache.org


Re: Is IndexSearcher thread safe?

Posted by Volodymyr Bychkoviak <vb...@i-hypergrid.com>.
Additional question.
If I'm sharing one instance of IndexSearcher between different threads 
Is it good to just to drop this instance to GC.
Because I don't know if some thread is still using this searcher or done 
with it.

Regards,
Volodymyr Bychkoviak


Volodymyr Bychkoviak wrote:

> Is it thread-safe to share one
> instance of IndexSearcher between multiple threads?
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: lucene-user-help@jakarta.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-user-help@jakarta.apache.org