Yes:

IndexReader newInner=in.reopen();
      if (in!=newInner)
      {
        in.close();
        this.in=newInner;

        // code to clean up my data
        _cache.clear();
        _indexData.load(this, true);
        init(_fieldConfig);
      }

if I change this code to:
try
      {
        this.in.close();     force close
      }
      catch(Exception e)
      {
        logger.warn(e.getMessage());
      }
      finally
      {
        this.in=newReader(); <-- new instance of IndexReader
        _cache.clear();
        _indexData.load(this, true);
        init(_fieldConfig);
      }

fixes my leak.

-John

On Thu, May 29, 2008 at 12:35 AM, Michael Busch <[EMAIL PROTECTED]> wrote:

> Could you share some details about how you implemented reopen() in your
> reader?
>
> -Michael
>
>
> John Wang wrote:
>
>> Yes, I do close the old reader.
>> I have a large index, my system is doing real time updates: 1 thread
>> writing
>> batches of updates to the index, after each index update, it updates the
>> reader. I have two readers open always, one is serving the search
>> requests,
>> while the other updates and the two flips. Reader update implies index
>> reopen here.
>>
>> I am using my implementation of a FilteredIndexReader.
>>
>> Index leaks very slowly, but obvious.
>>
>> No, I am not able to provide heap dumps.
>>
>> -John
>>
>> On Wed, May 28, 2008 at 4:23 PM, Mark Miller <[EMAIL PROTECTED]>
>> wrote:
>>
>>  As someone that has done a lot of reopens, I can vouch there is no leak
>>> under simple, normal usage. Are you sure your closing the original reader
>>> after getting the reopened reference?
>>>
>>>
>>> Michael Busch wrote:
>>>
>>>  Hi John,
>>>>
>>>> hmm not good. I will take a look. It has probably to do with the
>>>> reference
>>>> counting. Are you doing anything special? E. g. do you have own reader
>>>> implementations that you call reopen() on? What kinds of readers are you
>>>> using?
>>>>
>>>> Are you maybe able to provide a heapdump?
>>>>
>>>> -Michael
>>>>
>>>> John Wang wrote:
>>>>
>>>>  Hi:
>>>>>
>>>>>  We are experiencing memory leak with calling IndexReader.reopen().
>>>>>
>>>>>  From eyeballing the lucene source code, I am seeing normCache is not
>>>>> cleared.
>>>>>
>>>>>
>>>>>  Anyone else experiencing this?
>>>>>
>>>>> Thanks
>>>>>
>>>>> -John
>>>>>
>>>>>
>>>>>  ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>>>> For additional commands, e-mail: [EMAIL PROTECTED]
>>>>
>>>>
>>>>  ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>>> For additional commands, e-mail: [EMAIL PROTECTED]
>>>
>>>
>>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

Reply via email to