lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael McCandless <>
Subject Re: heap memory issues when sorting by a string field
Date Thu, 10 Dec 2009 10:51:44 GMT
On Thu, Dec 10, 2009 at 2:05 AM, Ganesh <> wrote:
> I think, This problem will happen for all sorted fields. I am sorting on integer field.

Integer field should take much less RAM than String, today, for
sorting.  And there's no efficiency gained by doing this globally (per
segment is just fine).

> I ran small test and found after closing all the Database, the WeekHashMap and int[]
are not released. Please find the profiler screenshot attached.
> Is there any way to release this memory / How to fix it externally with 2.9.1 ?

GC will "eventually" reclaim it, but there is this issue in progress:

to improve the immediacy, ie, on closing your reader, the FieldCache
entries will be reclaimed.  (There's also an exciting LUCENE-2133 in
progress, with a good improvement to FieldCache, that'll fix the issue
even better).

> If we reopen the DB multiple times whether these objects will be accumulated / All readers
are referenced to single cache?

They'll be GCd, as long as your app doesn't hold references to the old
readers.  They're stored in a WeakHashMap, keyed by the IndexReader.


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

View raw message