Actually, it's good to use a SoftReference-based pool in production, and a 
WeakReference-based pool in development and debugging. It makes it a lot easier to 
test what will happen when instances start getting collected.

Bob

On Fri, Jan 25, 2002 at 07:53:15AM -0600, Waldhoff, Rodney wrote:
> That should probably be SoftReference--so that the pooled object may be
> gc'ed if memory is tight.
> 
> -----Original Message-----
> From: Slawek Zachcial
> To: [EMAIL PROTECTED]
> Sent: 1/25/02 3:16 AM
> Subject: ObjectPool - weak reference based impl
> 
> Hi,
> 
> I noticed that on the pool todo list there is the
> action to implement weak reference based pool.
> 
> Can someone explain to me what is the reason/need
> behind? Should the idle pool objects be stored with
> weak references?
> 
> My understanding is that you use object pool to avoid
> the unnecessary object creation and rather reuse the
> existing ones.
> 
> With weak references the object may/will be cleared
> once it becomes weakly reachable. So if idle pool
> objects are weakly reachable you cannot be sure that
> they will not be garbage collected.
> 
> I'm not a reference specialist so please help me to
> understand :-)
> 
> Best Regards,
> Slawek Zachcial
> 
> __________________________________________________
> Do You Yahoo!?
> Great stuff seeking new owners in Yahoo! Auctions! 
> http://auctions.yahoo.com
> 
> --
> To unsubscribe, e-mail:
> <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
> <mailto:[EMAIL PROTECTED]>

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to