Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Lucene: Java-User
Re: Lucene appears to use memory maps after unmapping them
 

Index | Next | Previous | View Flat


rcmuir at gmail

Jan 31, 2012, 6:14 PM


Views: 461
Permalink
Re: Lucene appears to use memory maps after unmapping them [In reply to]

On Tue, Jan 31, 2012 at 8:32 PM, Trejkaz <trejkaz [at] trypticon> wrote:
> On Wed, Feb 1, 2012 at 11:30 AM, Robert Muir <rcmuir [at] gmail> 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?
>

No, I don't think you should use close at all, because your problem is
you are calling close() when its unsafe to do so (you still have other
threads that try to search the reader after you closed it).

Instead of trying to fix the bugs in your code, I suggested using
SearcherManager, which uses IndexReaders reference counting API (or
you can use that directly alternatively).

--
lucidimagination.com

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe [at] lucene
For additional commands, e-mail: java-user-help [at] lucene

Subject User Time
Lucene appears to use memory maps after unmapping them trejkaz at trypticon Jan 31, 2012, 4:16 PM
    Re: Lucene appears to use memory maps after unmapping them rcmuir at gmail Jan 31, 2012, 4:30 PM
    Re: Lucene appears to use memory maps after unmapping them trejkaz at trypticon Jan 31, 2012, 5:32 PM
    Re: Lucene appears to use memory maps after unmapping them rcmuir at gmail Jan 31, 2012, 6:14 PM
    Re: Lucene appears to use memory maps after unmapping them trejkaz at trypticon Jan 31, 2012, 6:42 PM
    Re: Lucene appears to use memory maps after unmapping them lucene at mikemccandless Feb 1, 2012, 3:25 AM
    RE: Lucene appears to use memory maps after unmapping them uwe at thetaphi Feb 1, 2012, 3:44 AM

  Index | Next | Previous | View Flat
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.