commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sy Andrew <>
Subject [Pool] GenericObjectPool release of resources during garbage coll ection
Date Mon, 08 Sep 2003 22:48:22 GMT

When an instance of GenericObjectPool is about to be garbage collected, does
it release the objects/resources in its pool (e.g. by calling the
PoolableObjectFactory.destroyObject(Object) method)? I plan to use
GenericObjectPool to pool some objects, where each of these objects is
holding on to a network connection. Ideally, the connections should always
be closed cleanly. 

Of course I can also implement finalize() on my own objects, or use a
PhantomReference to the GenericObjectPool instance to ensure that this
happens. But I just wanted to make sure first that GenericObjectPool is not
already doing the work for me. I looked at the source code for
GenericObjectPool and it did not seem to be doing this functionality. But
since it's my first time looking at the code, can anyone confirm this?

This message and any included attachments are from Siemens Medical Solutions 
USA, Inc. and are intended only for the addressee(s).  
The information contained herein may include trade secrets or privileged or 
otherwise confidential information.  Unauthorized review, forwarding, printing, 
copying, distributing, or using such information is strictly prohibited and may 
be unlawful.  If you received this message in error, or have reason to believe 
you are not authorized to receive it, please promptly delete this message and 
notify the sender by e-mail with a copy to  Thank you

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

View raw message