You are sure you don't have a reference to that old Reader somewhere, hanging around? Maybe this is fixed since I grabbed my copy of Lucene , but I can loop a reopen pretty much forever, and monitoring the memory I see not even the tiniest leak over many many many reopens. Ive been using visualgc, jconsole, and netbeans profiler. I am reopening pretty much exactly as your code shows.

John Wang wrote:
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:



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to