[
https://issues.apache.org/jira/browse/CURATOR-354?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15553196#comment-15553196
]
ASF GitHub Bot commented on CURATOR-354:
----------------------------------------
GitHub user epollan opened a pull request:
https://github.com/apache/curator/pull/168
CURATOR-354: native memory leak in GzipCompressionProvider
explicitly close GZIP input/output streams in GzipCompressionProvider
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/epollan/curator CURATOR-354
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/curator/pull/168.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #168
----
commit 8c1b4be57ffaf58ce8708e0e9d3611e4e5955f2e
Author: Evan Pollan <[email protected]>
Date: 2016-10-06T20:53:04Z
CURATOR-354: explicitly close GZIP input/output streams in
GzipCompressionProvider
----
> GzipCompressionProvider leaks native memory
> -------------------------------------------
>
> Key: CURATOR-354
> URL: https://issues.apache.org/jira/browse/CURATOR-354
> Project: Apache Curator
> Issue Type: Bug
> Affects Versions: 2.11.0
> Reporter: Evan Pollan
> Assignee: Jordan Zimmerman
> Attachments: RSS before and after fix.png
>
>
> Both compress and decompress instantiate GZIP streams, use them, and don't
> close them. The java util deflate/inflate streams use JNI to leverage zlib,
> including the allocation of a native, off-heap buffer.
> These JNI buffer handles are released when the containing stream is closed.
> They're also released by the finalize() method on
> java.util.zip.Inflater/Deflater, _but_ it looks as if the native memory can
> pile up quickly enough in certain use cases where the JVM is OOM killed
> before the finalizer does its thing.
> Fix is to explicitly close these streams after they're used.
> This was discovered in version 2.11.0, but it looks like the problem affects
> all versions for which {{GzipCompressionProvider}} existed.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)