Puneet Lakhina wrote: > On 10/18/07, Roland Weber <[EMAIL PROTECTED]> wrote: >> Puneet Lakhina wrote: >>> public void run() { >>> >>> HttpClient client = new HttpClient(); >>> PostMethod postMethod = new PostMethod(sameURL); >>> /*Set parameters in post method*/ >>> client.executeMethod(); >>> /*Do something with the response*/ >>> postMethod.releaseConnection(); >>> } >> This will leak a connection for every request, until they >> are released by garbage collection. > > > Isnt postMethod.releaseConnection() done to prevent that??
Sorry, my wording was misleading. I should have written "until they are closed by garbage collection". To release is not to close, as you will learn from the "Connection Persistence" section of the Performance Tuning Guide: http://jakarta.apache.org/httpcomponents/httpclient-3.x/performance.html cheers, Roland --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]