Ortwin Glück wrote:
Oleg Kalnichevski wrote:

Are there any reasons for NOT automatically releasing connection? I
can't think of any.


Right. I think HttpClient should abstract the physical connections away from the user. So connection handling must be completely inside HttpClient. The only "exception" is that the user must signal HttpClient when he is done with a method so the connection can be released. Still, if the user forgets that, the connection must be released at the very latest at garbage collection time.


Releasing at finalization is implemented (via ReferenceQueue), but that's not a panacea: if memory usage is light, GC comes long after the application is wedged up waiting for a connection to be freed. That was the behavior I saw that led to the referenced discussion.


-danch


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



Reply via email to