On Fri, 2019-02-22 at 13:14 +0100, Joan Balagueró wrote:
> Hello,
> 
>  
> 
> When I shutdown my ‘CloseableHttpAsyncClient’instance (that has set a
> ‘PoolingAsyncClientConnectionManager’) a thread called ‘httpclient-
> main-1’
> is not stopped and the following message is logged in tomcat log:
> 
>  
> 
> 22-Feb-2019 13:00:59.326 ADVERTENCIA [localhost-startStop-1]
> org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesThrea
> ds The
> web application [ROOT] appears to have started a thread named
> [httpclient-main-1] but has failed to stop it. This is very likely to
> create
> a memory leak. Stack trace of thread:
> 
> sun.misc.Unsafe.park(Native Method)
> 
> java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
> 
> java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject
> .await(
> AbstractQueuedSynchronizer.java:2039)
> 
> java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.jav
> a:442)
> 
> java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.ja
> va:1074
> )
> 
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.
> java:11
> 34)
> 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor
> .java:6
> 24)
> 
> java.lang.Thread.run(Thread.java:748)
> 
>  
> 
> Our code to shutdown:
> 
> public void stop() throws IOException
> 
> { 
> 
>   this.phccm.close(CloseMode.GRACEFUL); // close the
> ‘PoolingAsyncClientConnectionManager’’ gracefully
> 
>   this.objHttp.close();                 // close the
> ‘CloseableHttpAsyncClient’instance 
> 
> }
> 
>  
> 
> Is this something I’m forgetting to close or it’s a matter of the
> Httpclient?
> 

Please post a test app reproducing the problem outside the servlet
container.

Oleg


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to