DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=25372>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=25372

auto close idle connections





------- Additional Comments From [EMAIL PROTECTED]  2004-04-20 02:42 -------
> 1) Looks like IdleConnectionHandler will have multi-threading issues: the add
> method modifies the tree, while the closeIdleConnections method is trying to
> iterate through the keySet.

Yes, it does not provide synchronized access.  This is up to the connection manager to 
take care of.  
The multi-threaded connection manager handles this correctly, and it is mentioned in 
the 
IdleConnectionHandler Javadocs. 

> 2) I'm not sure I understand why IdleConnectionHandler has a tree of lists (very
> expensive structure) as well as a hashset. Can't we handle this with just a
> simple list and a hashset?

It may be a little heavy, but it works more efficiently as the number of connections 
increases.

> 3) If IdleConnectionHandler.closeIdleConnections is never called, will the tree
> structure ever get cleaned up? Is there a memory leak under this condition?

It will eventually get GCed if all references to it are lost.  The connections are not 
guaranteed to be 
closed though.

> 4) Can we add a simple utility class that implements thread and calls
> IdleConnectionHandler.closeIdleConnections so that everyone doesn't have to
> write their own?

Sounds like a decent idea.

Mike

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

Reply via email to