lucenenet-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "George Aroush" <>
Subject RE: Lucene.Net Indexing Large Databases
Date Mon, 11 Sep 2006 00:50:12 GMT
Hi Folks,

Since last weekend, I have been trying to narrow down the problem to this
memory leak without much of a luck.

Does anyone have a tool (or could recommend one, without costing me $$)
which hopefully show the source of the leak?

Unlike C++ code, the leak here, obviously, is due to not releasing
references to temporary or real objects.  The trick is finding the object.

This leak can be created with this simple code:

	public static void  Main(System.String[] args)
		IndexWriter diskIndex;
		Directory   directory;
		Analyzer    analyzer;
		Document    doc;
		int         count;
		string      indexDirectory;
		System.IO.FileInfo  fi;

		indexDirectory = "C:\\Index.Bad";

		fi = new System.IO.FileInfo(indexDirectory);
		directory = Lucene.Net.Store.FSDirectory.GetDirectory(fi,
		analyzer = new SimpleAnalyzer();
		diskIndex = new IndexWriter(directory, analyzer, true);
		count = 0;
		while (count < 10000)
			doc = new Document();


This code will show a leak in 1.9, 1.9.1 and 2.0 but not 1.4.3.  I also
verified and it doesn't leak under the Java version of Lucene (2.0 is where
I tested.)


-- George

-----Original Message-----
From: George Aroush [] 
Sent: Friday, September 01, 2006 9:21 PM
Subject: RE: Lucene.Net Indexing Large Databases

Hi Chris,

I am using 1.9.1 in production and I am not having this problem.  Sorry, I
don't have enough cycles to try your code on 1.9.

This problem was reported on 1.4.x and was fixed.  I am sure I carried it
over to 1.9.x and 2.0 -- or maybe this is a new issue.  I will double check
when I get the cycles.

You can get 1.4.3's source code as ZIP from the download site of Lucene.Net
which is here: or you
can SVN the source code from here:


-- George Aroush

-----Original Message-----
From: Chris David []
Sent: Friday, September 01, 2006 1:46 PM
Subject: RE: Lucene.Net Indexing Large Databases

Thanks René, so its not just me with this problem.  Now where can I get a
hold of this wonderful 1.4 Build of Lucene.  Its not listed directly on
Apache's Lucene.NET Page. I am anxious to see if my code actually does work.
Thanks again for all your help, I really do appreciate it.

Snapstream Media
-----Original Message-----
From: René de Vries []
Sent: Friday, September 01, 2006 7:32 AM
Subject: RE: Lucene.Net Indexing Large Databases

Update: I didn't realize my earlier code example ran against 1.4. 

If I run this with 1.9final-005 build, I am experiencing the exact same
problems as Chris mentions. Memory consumtion keeps growing, I had to kill
it at 1.5Gb. Exact same code, but with a 1.4 version of the DLL,
and it runs along at 50Mb


View raw message