On 12/19/06, Otis Gospodnetic <[EMAIL PROTECTED]> wrote:
I _think_ Robert is right and ThreadLocals are not the problem (I tried getting
rid of them, and replacing them with an instance var last week, but run into
problems with multi-threaded unit tests).
If you want to try getting rid of the ThreadLocals, you can't replace
with instance vars because the stuff put into the Threadlocals isn't
thread safe.
Replace the ThreadLocal stuff with the code that populated it in the
first place.
So for instance, in TermInfosReader, replace this
private SegmentTermEnum getEnum() {
SegmentTermEnum termEnum = (SegmentTermEnum)enumerators.get();
if (termEnum == null) {
termEnum = terms();
enumerators.set(termEnum);
}
return termEnum;
}
With this:
private SegmentTermEnum getEnum() {
return terms()
}
What I'm seeing while profiling (and in production) is the accumulation of
these:
org.apache.lucene.search.FieldCacheImpl$Entry
org.apache.lucene.search.FieldCacheImpl$CreationPlaceholder
This is related to http://issues.apache.org/jira/browse/LUCENE-651 (the commit
for that patch also happens to coincide with when I started seeing the leak).
I'll take a look into that. Solr hasn't sync'd to that version of
Lucene yet, so we haven't seen this problem of course :-)
-Yonik
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]