On Tue, 2006-01-24 at 13:10 +0000, sebb wrote: > On 23/01/06, Oleg Kalnichevski <[EMAIL PROTECTED]> wrote: > > On Mon, 2006-01-23 at 19:47 +0000, sebb wrote: > > > Might be useful to add a finalizer which logs a warning if the Manager > > > has not been shut down properly? > > > > > > Sebastian > > > > > > > Sebastian, > > There are situations where such a warning would be inappropriate. > > Consider the case of HttpClient being used as a singleton. We might, > > Not sure I understand what you mean here - surely even a singleton > needs to be closed properly?
Probably not, as long as the connection manager is meant to be active for the whole lifespan of the JVM process The real trouble with the connection managers is their reliance on the garbage collector to close persistent connections rather the fact that connection managers necessarily need to be shut down. The existing connection managers work fine as long as one does not do something exceptionally silly, such as creating a new connection manager per request in a tight loop, which in no time results in thousands of connection managers waiting to be GC-ed, each holding on open connection. Hope that explains it. Oleg > > > however, run a simple static counter of how many connection managers > > have been GC-ed without having been properly shut down and start > > printing warnings beyond a certain threshold in order to circumvent the > > problem. > > > > OK. > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]