Return-Path: Delivered-To: apmail-incubator-lucene-net-user-archive@locus.apache.org Received: (qmail 95666 invoked from network); 29 Sep 2006 07:53:57 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 29 Sep 2006 07:53:57 -0000 Received: (qmail 47714 invoked by uid 500); 29 Sep 2006 07:53:57 -0000 Delivered-To: apmail-incubator-lucene-net-user-archive@incubator.apache.org Received: (qmail 47675 invoked by uid 500); 29 Sep 2006 07:53:57 -0000 Mailing-List: contact lucene-net-user-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: lucene-net-user@incubator.apache.org Delivered-To: mailing list lucene-net-user@incubator.apache.org Received: (qmail 47666 invoked by uid 99); 29 Sep 2006 07:53:56 -0000 Received: from idunn.apache.osuosl.org (HELO idunn.apache.osuosl.org) (140.211.166.84) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 29 Sep 2006 00:53:56 -0700 X-ASF-Spam-Status: No, hits=0.0 required=5.0 tests= Received: from [213.165.64.20] ([213.165.64.20:39914] helo=mail.gmx.net) by idunn.apache.osuosl.org (ecelerity 2.1.1.8 r(12930)) with ESMTP id 52/62-10102-111DC154 for ; Fri, 29 Sep 2006 00:53:54 -0700 Received: (qmail invoked by alias); 29 Sep 2006 07:53:50 -0000 Received: from p549C18E0.dip0.t-ipconnect.de (EHLO MOB217) [84.156.24.224] by mail.gmx.net (mp038) with SMTP; 29 Sep 2006 09:53:50 +0200 X-Authenticated: #6569119 From: "Torsten Rendelmann" To: , Subject: RE: Memory leak (was: RE: Lucene.Net Indexing Large Databases) Date: Fri, 29 Sep 2006 09:53:46 +0200 Message-ID: <003901c6e39c$64d594c0$0701a8c0@lan.procos.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 11 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2962 Thread-Index: Acbgu+03miJVc+0xQaS6uAV9tQRQVwCafpngAB1U1CA= In-Reply-To: <001901c6e326$aba5f3c0$ee6ffea9@aroushlt> X-Y-GMX-Trusted: 0 X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N 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 > >