Re: ThreadLocal in SegmentReader

2008-07-14 Thread robert engels
et, ThreadLocal is very convenient for avoiding synchronization. Does anyone have any ideas on how to solve this w/o falling back to "normal" synchronization? Mike Begin forwarded message: From: "Yonik Seeley" <[EMAIL PROTECTED]> Date: July 7, 2008 3:30:28 PM EDT To: [EMAI

Re: ThreadLocal in SegmentReader

2008-07-14 Thread Roman Puchkovskiy
gt; The instance ThreadLocals (and what the refer to) will be GC'd >>>>>>>>>> when the containing Object is GC'd. >>>>>>>>>> >>>>>>>>>> There IS NO MEMORY LEAK in ThreadLocal. If the ThreadLocal >>>>>>

Re: ThreadLocal in SegmentReader

2008-07-14 Thread robert engels
e ThreadLocal is holding strong references. Yet, ThreadLocal is very convenient for avoiding synchronization. Does anyone have any ideas on how to solve this w/o falling back to "normal" synchronization? Mike Begin forwarded message: From: "Yonik Seeley" <[EMAIL PROTECTED]>

Re: ThreadLocal in SegmentReader

2008-07-13 Thread Roman Puchkovskiy
endent of the rest of the code(no >>>>>>>>> dependencies).Otherwise it can get pretty tricky(memory leaks, >>>>>>>>> classloader problems) after awhile. >>>>>>>>> >>>>>>>>> It is pretty convenie

Re: ThreadLocal in SegmentReader

2008-07-13 Thread Roman Puchkovskiy
>>>>>>>> as you release the object within a try {} finall {} block or >>>>>>>>> store objects which are independent of the rest of the code(no >>>>>>>>> dependencies).Otherwise it can get pretty tricky(memory leaks, >>>>>>>&g

Re: ThreadLocal in SegmentReader

2008-07-12 Thread robert engels
olve this w/o falling back to "normal" synchronization? Mike Begin forwarded message: From: "Yonik Seeley" <[EMAIL PROTECTED]> Date: July 7, 2008 3:30:28 PM EDT To: [EMAIL PROTECTED] Subject: Re: ThreadLocal in SegmentReader Reply-To: [EMAIL PROTECTED] On Mon, Jul 7, 200

Re: ThreadLocal in SegmentReader

2008-07-12 Thread Roman Puchkovskiy
ell ... SegmentReader uses ThreadLocal to hold a thread- >>>>>>>>> private instance of TermVectorsReader, to avoid synchronizing >>>>>>>>> per-document when loading term vectors. >>>>>>>>> >>>>>>

Re: ThreadLocal in SegmentReader

2008-07-11 Thread robert engels
strong references. Yet, ThreadLocal is very convenient for avoiding synchronization. Does anyone have any ideas on how to solve this w/o falling back to "normal" synchronization? Mike Begin forwarded message: From: "Yonik Seeley" <[EMAIL PROTECTED]> Date: July 7,

Re: ThreadLocal in SegmentReader

2008-07-11 Thread Roman Puchkovskiy
uses a >>>>>>> HashMap, which we'd have to synchronize on when getting the per- >>>>>>> thread instances. Or, go back to sharing a single >>>>>>> TermVectorsReader and synchronize per-document. >>>>>>> >

Re: ThreadLocal in SegmentReader

2008-07-11 Thread robert engels
because the ThreadLocal is holding strong references. Yet, ThreadLocal is very convenient for avoiding synchronization. Does anyone have any ideas on how to solve this w/o falling back to "normal" synchronization? Mike Begin forwarded message: From: "Yonik Seeley"

Re: ThreadLocal in SegmentReader

2008-07-11 Thread Michael McCandless
's classes because the ThreadLocal is holding strong references. Yet, ThreadLocal is very convenient for avoiding synchronization. Does anyone have any ideas on how to solve this w/o falling back to "normal" synchronization? Mike Begin forwarded message: From: "Yon

Re: ThreadLocal in SegmentReader

2008-07-09 Thread Adrian Tarau
s very convenient for avoiding synchronization. Does anyone have any ideas on how to solve this w/o falling back to "normal" synchronization? Mike Begin forwarded message: From: "Yonik Seeley" <[EMAIL PROTECTED]> Date: July 7, 2008 3:30:28 PM EDT To: [EMAIL PROTECTED] Su

Re: ThreadLocal in SegmentReader

2008-07-08 Thread robert engels
Seeley" <[EMAIL PROTECTED]> Date: July 7, 2008 3:30:28 PM EDT To: [EMAIL PROTECTED] Subject: Re: ThreadLocal in SegmentReader Reply-To: [EMAIL PROTECTED] On Mon, Jul 7, 2008 at 2:43 PM, Michael McCandless <[EMAIL PROTECTED]> wrote: So now I'm confused: the SegmentReader itself

Re: ThreadLocal in SegmentReader

2008-07-08 Thread Jason Rutherglen
e the classloader never fully deallocates Lucene's classes >>> because the ThreadLocal is holding strong references. >>> >>> Yet, ThreadLocal is very convenient for avoiding synchronization. >>> >>> Does anyone have any ideas on how to solve this w/o f

Re: ThreadLocal in SegmentReader

2008-07-08 Thread Michael McCandless
, 2008 3:30:28 PM EDT To: [EMAIL PROTECTED] Subject: Re: ThreadLocal in SegmentReader Reply-To: [EMAIL PROTECTED] On Mon, Jul 7, 2008 at 2:43 PM, Michael McCandless <[EMAIL PROTECTED]> wrote: So now I'm confused: the SegmentReader itself should no longer be reachable, assuming you ar