lucenenet-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ayende Rahien" <aye...@ayende.com>
Subject Re: Possible leaks in SegmentReader and TermInfosReader
Date Thu, 29 Mar 2007 20:35:53 GMT
That is a bad idea in general, since threads usually don't die.
If we take a traditional ASP.Net application, the threads are on the thread
pool, and are mostly busy serving requests, they don't tend to die that
often.

On 3/29/07, Joe Shaw <joe@ximian.com> wrote:
>
> Hi,
>
> On 3/29/07, Vova Tymchenko <halleck1@yahoo.com> wrote:
> > The trouble that I see with SegmentReader (and TermInfosReader as well)
> is that it stores references
> > to TermVectorsReader in ThreadLocalStore when GetTermVectorsReader is
> called, but .Close method fails
> > to close and clean up that reference.
>
> I believe the idea here (at least for TermInfosReader) is to cache
> that object so that multiple searches on the same thread do not have
> to continuously reopen the term info file, which can be a pretty big
> performance hit.  Removing the reference in DoClose() will effectively
> undo this optimization.
>
> I think that the references to the data stored in the ThreadLocalStore
> will be GCable once the thread containing it dies.
>
> There was a recent thread about this on the java-dev list, in which
> someone thought that ThreadLocals were causing a leak, but it turned
> out to be a bug in the user's code:
>
>
> http://www.archivum.info/java-dev@lucene.apache.org/2006-12/msg00273.html
>
> Joe
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message