lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Heng Mei" <heng....@gmail.com>
Subject IndexSearcher memory leak?
Date Wed, 05 Jul 2006 23:58:03 GMT
Hi experts,
There seems to be a strange memory leak with the IndexSearcher.
I get an OutOfMemoryException after a few iterations of the following loop:
LOOP:
 	ramdir = new RAMDirectory( "path/to/my/directory" );
	searcher = new IndexSearcher( reader );
        searcher.search(new TermQuery( new Term( "field", "keyword")));
        searcher.close();
        ramdir.close();
END LOOP:
Note, ramdir and searcher are both instance variables.
The index is about 100mb, and the process is run with -Xmx256m.
**Strangely enough, if I comment out the "searcher.search()" line,
then there is no error.   Or, if I make searcher a local variable
(instead of an instance variable), then there also is no error.  I'm
running this on windows xp.

Has anyone observed this type of behavior before?
Any idea what might be causing the memory leak?

much thanks,
~Heng

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message