Title: ApacheDockerHttpClient may cause memory leak · Issue #1559 · docker-java/docker-java · GitHub
Open Graph Title: ApacheDockerHttpClient may cause memory leak · Issue #1559 · docker-java/docker-java
X Title: ApacheDockerHttpClient may cause memory leak · Issue #1559 · docker-java/docker-java
Description: ApacheDockerHttpClient may cause memory leak when client tls verify is set to true and client certificate is provided. DockerClientConfig custom = DefaultDockerClientConfig.createDefaultConfigBuilder() .withDockerHost("tcp://docker.somew...
Open Graph Description: ApacheDockerHttpClient may cause memory leak when client tls verify is set to true and client certificate is provided. DockerClientConfig custom = DefaultDockerClientConfig.createDefaultConfigBuild...
X Description: ApacheDockerHttpClient may cause memory leak when client tls verify is set to true and client certificate is provided. DockerClientConfig custom = DefaultDockerClientConfig.createDefaultConfigBuild...
Opengraph URL: https://github.com/docker-java/docker-java/issues/1559
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"ApacheDockerHttpClient may cause memory leak","articleBody":"ApacheDockerHttpClient may cause memory leak when client tls verify is set to true and client certificate is provided.\r\n\r\nDockerClientConfig custom = DefaultDockerClientConfig.createDefaultConfigBuilder()\r\n .withDockerHost(\"tcp://docker.somewhere.tld:2376\")\r\n .withDockerTlsVerify(true)\r\n .withDockerCertPath(\"/home/user/.docker\")\r\n .withRegistryUsername(registryUser)\r\n .withRegistryPassword(registryPass)\r\n .withRegistryEmail(registryMail)\r\n .withRegistryUrl(registryUrl)\r\n .build();\r\n\r\nDockerHttpClient httpClient = new ApacheDockerHttpClient.Builder()\r\n .dockerHost(custom.getDockerHost())\r\n .sslConfig(custom.getSSLConfig())\r\n .build();\r\n\r\nThe code is copied from https://github.com/docker-java/docker-java/blob/master/docs/getting_started.md\r\n\r\nThe problem is when build ApacheDockerHttpClient, the maxConnections parameter is not set, the default value is Integer.MAX_VALUE. HttpClient will not reuse the connection when using a client certificate, the result is HttpClient create a new connection for every request and never release one. [Here](https://stackoverflow.com/questions/13034998/httpclient-is-not-re-using-my-connections-keeps-creating-new-ones) is the explanation.\r\n\r\nSuggestion:\r\nDisable connection state when build the HttpClient.\r\n\r\nhttpClient = HttpClients.custom().disableConnectionState()...\r\n\r\n\r\n\r\n","author":{"url":"https://github.com/internalerror","@type":"Person","name":"internalerror"},"datePublished":"2021-03-15T16:00:25.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/1559/docker-java/issues/1559"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:a3c517e1-c1bb-e2d4-19c9-aea948504371 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 96CE:11B87F:D0A637:1192B68:6973D38C |
| html-safe-nonce | 83531c3833dcb8dd0a01f9b1fd8bf648058905056e6786a5fd701cc853e6999a |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5NkNFOjExQjg3RjpEMEE2Mzc6MTE5MkI2ODo2OTczRDM4QyIsInZpc2l0b3JfaWQiOiI4MDI2ODY5NDc1MDk0ODExNTMyIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 6ca26cd76aa844679a51794f883d1bf47fb428bebda7f4f4bb714bced8ce271d |
| hovercard-subject-tag | issue:831956492 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/docker-java/docker-java/1559/issue_layout |
| twitter:image | https://opengraph.githubassets.com/44435b18ea3e8781a6b2b6aadee95dc5d8521391080940c4ccf505cba575090f/docker-java/docker-java/issues/1559 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/44435b18ea3e8781a6b2b6aadee95dc5d8521391080940c4ccf505cba575090f/docker-java/docker-java/issues/1559 |
| og:image:alt | ApacheDockerHttpClient may cause memory leak when client tls verify is set to true and client certificate is provided. DockerClientConfig custom = DefaultDockerClientConfig.createDefaultConfigBuild... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | internalerror |
| hostname | github.com |
| expected-hostname | github.com |
| None | 4c466014c8820edcdcbef69f57f90d1c8041009ca459463b96b062ebca83c424 |
| turbo-cache-control | no-preview |
| go-import | github.com/docker-java/docker-java git https://github.com/docker-java/docker-java.git |
| octolytics-dimension-user_id | 7772003 |
| octolytics-dimension-user_login | docker-java |
| octolytics-dimension-repository_id | 20415251 |
| octolytics-dimension-repository_nwo | docker-java/docker-java |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 20415251 |
| octolytics-dimension-repository_network_root_nwo | docker-java/docker-java |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | b4cd3a8af1483283fd4c6bcf6e24fd9fc8ab0e78 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width