lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dangabhay <>
Subject Memory leak with Lucene Search ?
Date Tue, 12 Jul 2011 10:52:02 GMT
Hi all,

We are using Lucene 2.9.0 to power a search and are performing a large
number of searches. We are initializing our searcher with the code:

Directory directory = File(Constants.IndexLocation));
Searcher searcher = new IndexSearcher(directory,true);

Upon every search request, we are performing the following

TopDocs results =,Constants.MAXHITS);

As expected, the first request takes up a large amount of time as the index
warms up. However, we have noticed that the time taken keeps decreasing
continuously as and when more results are served. My guess is that results
are being cached somewhere.

The runtime classes for directory and index reader are as follows:

Eventually, JVM runs out of memory as we see from jvm stats that old
generation capacity reaches the maximum. We are using Concurrent Mark sweep
GC strategy, and it gets invoked during every search request thereafter.

I have tried looking for answers in forums, but couldn't find any. As per
many threads, there is no caching involved in Lucene by default, unless
QueryFilter and CachingWrapperFilter are used. I tried looking into Lucene
code also a bit, but couldn't find any clues.

Does anyone have any pointers as to why this could be happening ? 


View this message in context:
Sent from the Lucene - Java Users mailing list archive at

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message