RE: Memory leak in CloseableHttpAsyncClient?

2016-10-17 Thread Rob Griffin
I've raised the issue https://issues.apache.org/jira/browse/HTTPASYNC-116 

Regards,

Rob Griffin
Software Analyst, Spotlight on SQL Server 
Dell Software | R & D 
office +613 9811 8021 



-Original Message-
From: Oleg Kalnichevski [mailto:ol...@apache.org] 
Sent: Monday, 17 October 2016 11:58 PM
To: HttpClient User Discussion <httpclient-users@hc.apache.org>
Subject: Re: Memory leak in CloseableHttpAsyncClient?

On Sun, 2016-10-16 at 21:54 +, Rob Griffin wrote:
> We are using HTTPAsynchClient to send data to our web site from a Java 
> client. 
> 
> We call CloseableHttpAsyncClient.execute() to execute HTTP PUTs at the rate 
> of several hundred per minute. Sometimes our web site slows down and does not 
> respond quickly enough and when this occurs the requests back up. We have 
> code that detects this and cancels the Future returned from the execute 
> method when the request has waited too long. If this happens too often the 
> application crashes with an out of memory error. 
> 
> Analysis of a dump showed that there were more 108,000 instances of 
> org.apache.http.nio.pool.LeaseRequest along with a similar number of 
> instances of other HTTP Client classes. Inspecting one of these objects 
> showed that its future variable is not cancelled but that by tracing though 
> the callback variables there is a cancelled Future further up the chain. That 
> cancelled Future object is one returned by execute because its callback is 
> one of our classes. To me it appears that the library is unaware that cancel 
> has been called on the Future returned by execute() and so keeps a reference 
> to it.
> 
> See 
> [url=https://postimg.org/image/j6zfdrquf/][img]https://s15.postimg.org
> /qa7atdwa3/Screen_Shot010.jpg[/img][/url][url=https://postimage.org/]i
> mage url[/url]
> 
> Regards,
> 
> Rob Griffin

Hi Rob

Currently cancellation of the response future does not immediately results in 
cancellation pending connection lease request or termination of the request 
execution.

Feel free to raise an improvement request in Jira.

Oleg



-
To unsubscribe, e-mail: httpclient-users-unsubscr...@hc.apache.org
For additional commands, e-mail: httpclient-users-h...@hc.apache.org



Re: Memory leak in CloseableHttpAsyncClient?

2016-10-17 Thread Oleg Kalnichevski
On Sun, 2016-10-16 at 21:54 +, Rob Griffin wrote:
> We are using HTTPAsynchClient to send data to our web site from a Java 
> client. 
> 
> We call CloseableHttpAsyncClient.execute() to execute HTTP PUTs at the rate 
> of several hundred per minute. Sometimes our web site slows down and does not 
> respond quickly enough and when this occurs the requests back up. We have 
> code that detects this and cancels the Future returned from the execute 
> method when the request has waited too long. If this happens too often the 
> application crashes with an out of memory error. 
> 
> Analysis of a dump showed that there were more 108,000 instances of 
> org.apache.http.nio.pool.LeaseRequest along with a similar number of 
> instances of other HTTP Client classes. Inspecting one of these objects 
> showed that its future variable is not cancelled but that by tracing though 
> the callback variables there is a cancelled Future further up the chain. That 
> cancelled Future object is one returned by execute because its callback is 
> one of our classes. To me it appears that the library is unaware that cancel 
> has been called on the Future returned by execute() and so keeps a reference 
> to it.
> 
> See 
> [url=https://postimg.org/image/j6zfdrquf/][img]https://s15.postimg.org/qa7atdwa3/Screen_Shot010.jpg[/img][/url][url=https://postimage.org/]image
>  url[/url] 
> 
> Regards,
> 
> Rob Griffin

Hi Rob

Currently cancellation of the response future does not immediately
results in cancellation pending connection lease request or termination
of the request execution.

Feel free to raise an improvement request in Jira.

Oleg



-
To unsubscribe, e-mail: httpclient-users-unsubscr...@hc.apache.org
For additional commands, e-mail: httpclient-users-h...@hc.apache.org