You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by "Justin Edelson (JIRA)" <ji...@apache.org> on 2016/06/08 18:23:21 UTC

[jira] [Created] (HTTPCLIENT-1749) Memory Leak in OSGi support

Justin Edelson created HTTPCLIENT-1749:
------------------------------------------

             Summary: Memory Leak in OSGi support
                 Key: HTTPCLIENT-1749
                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1749
             Project: HttpComponents HttpClient
          Issue Type: Bug
          Components: HttpClient
    Affects Versions: 4.5.2, 4.4.1
            Reporter: Justin Edelson


There is a memory leak in the HTTP Client OSGi support whereby the HttpProxyConfigurationActivator holds on to references to created HttpClient instances for the entire life of the httpclient-osgi bundle.

The clients are added here: http://grepcode.com/file/repo1.maven.org/maven2/org.apache.httpcomponents/httpclient-osgi/4.4.1/org/apache/http/osgi/impl/OSGiHttpClientBuilder.java#58

and not removed until http://grepcode.com/file/repo1.maven.org/maven2/org.apache.httpcomponents/httpclient-osgi/4.4.1/org/apache/http/osgi/impl/HttpProxyConfigurationActivator.java#115

This can be relatively easily fixed by using weak references. In addition, access to this collection needs to be synchronized because the additions may come from multiple threads.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org