commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Slawek Zachcial <>
Subject ObjectPool - weak reference based impl
Date Fri, 25 Jan 2002 09:16:09 GMT

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!

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

View raw message