lucenenet-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Torsten Rendelmann" <torsten.rendelm...@gmx.net>
Subject RE: Memory leak (was: RE: Lucene.Net Indexing Large Databases)
Date Fri, 29 Sep 2006 07:53:46 GMT
Gorge, 

AFAIK CLR 2.0 has a improved GC implemetation, that may 
handle things more aggressive than the older CLR 1.1 and 1.0
Implemetations, so the "leak" is not detected there.

Both mentioned classes has a empty finalizer, that is not
recommended by various MSDN articles (as the lifetime of a object
not anymore in use is increased).

Here are some good readings about how to handle (unmanaged)
resources (not memory!) as a starting point:
 
http://dotnetjunkies.com/WebLog/rajchaniansbiztalkblog/archive/2005/04/2
0/69429.aspx
  http://discuss.joelonsoftware.com/default.asp?dotnet.12.387957.17

TorstenR

> -----Original Message-----
> From: George Aroush [mailto:george@aroush.net] 
> Sent: Thursday, September 28, 2006 7:51 PM
> To: lucene-net-dev@incubator.apache.org; 
> lucene-net-user@incubator.apache.org
> Subject: RE: Memory leak (was: RE: Lucene.Net Indexing Large 
> Databases)
> 
> Hi Ben and all,
> 
> Thanks for the pointer Ben!
> 
> Removing the two unused (read: empty) finalizers from 
> SegmentReder.cs as
> well as TerminfoReader.cs eliminated the leak -- completely.
> 
> This makes me believe that .NET 1.1 has a bug and that this was not a
> Lucene.Net issue (specially when the same code, without 
> removing those empty
> finalizers works with .NET 2.0)
> 
> Over the next few days, I will run the NUnit test (I don't 
> expect anything
> to break) and will release this fix for Lucene.Net 1.9, 1.9.1 and 2.0
> 
> Regards,
> 
> -- George Aroush
> 
> -----Original Message-----
> From: Ben Tregenna [mailto:lucene@rekenys.com] 
> Sent: Monday, September 25, 2006 12:01 PM
> To: lucene-net-dev@incubator.apache.org
> Subject: Re: Memory leak (was: RE: Lucene.Net Indexing Large 
> Databases)
> 
> George Aroush wrote:
> 
> >Hi Michael,
> >
> >That is right.  If you take the current code as-is (without 
> the change 
> >to
> >Close() as I mentioned earlier) of Lucene.Net 1.9, 1.9.1 and 2.0 and 
> >compile them using .NET 2.0, you will not see any leak!
> >
> >What's even more puzzling to me is this.  If I add the 
> following code: 
> >
> >	~RAMOutputStream()
> >	{
> >		file = null;
> >	}
> > 
> >To the class Lucene.Net.Store.RAMOutputStream, the leak more 
> then doubles!!
> >  
> >
> 
> Seems similar to my observation that removing the (unused) 
> finaliser for
> TermInfosReader halved the memory leak.
> 
> I have to say the logic of the finaliser in C# isn't one of 
> my strong suits
> but I'm still poking around in the code occassionally as and 
> when I get the
> time...
> 
> Ben
> 
> 



Mime
View raw message