lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Trejkaz <trej...@trypticon.org>
Subject Re: Lucene appears to use memory maps after unmapping them
Date Wed, 01 Feb 2012 01:32:37 GMT
On Wed, Feb 1, 2012 at 11:30 AM, Robert Muir <rcmuir@gmail.com> wrote:
> the problem is caused by searching indexreaders after you closed them.
>
> in general we can try to add more and more safety, but at the end of the day,
> if you close an indexreader while a search is running, you will have problems.
>
> So be careful to only close indexreaders that are no longer in use!
>
> For multithreaded code you might want to investigate IndexReader's
> reference counting mechanism or SearcherManager to help you track
> this.

So rather than flagging closed = true when close() is called and
hitting someone who tries to read data, essentially try and do the
reverse- if a search is still running and close() is called, throw an
exception to them?

Some of our underlying code isn't only doing searches... so it still
might not catch all usages. But it should catch the more easily found
ones I hope.

I guess I would need to create a stack trace every time someone starts
a new search for this to work, so that there is some point of blame
when the exception fires. Otherwise I would be back at step 1, having
no idea who did the wrong thing.

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


Mime
View raw message