[
https://issues.apache.org/jira/browse/HADOOP-18383?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17575711#comment-17575711
]
ASF GitHub Bot commented on HADOOP-18383:
-----------------------------------------
kevins-29 commented on code in PR #4585:
URL: https://github.com/apache/hadoop/pull/4585#discussion_r938704526
##########
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/compress/zlib/BuiltInGzipCompressor.java:
##########
@@ -102,7 +103,15 @@ public int compress(byte[] b, int off, int len) throws
IOException {
if (state == BuiltInGzipDecompressor.GzipStateLabel.INFLATE_STREAM) {
// now compress it into b[]
- int deflated = deflater.deflate(b, off, len);
+ int deflated;
+ try {
+ deflated = deflater.deflate(b, off, len);
+ } catch (NullPointerException npe) {
Review Comment:
Thank you, I wasn't too comfortable with this either.
> Codecs with @DoNotPool annotation are not closed causing memory leak
> --------------------------------------------------------------------
>
> Key: HADOOP-18383
> URL: https://issues.apache.org/jira/browse/HADOOP-18383
> Project: Hadoop Common
> Issue Type: Bug
> Components: common
> Affects Versions: 3.3.2
> Reporter: Kevin Sewell
> Priority: Major
> Labels: pull-request-available
> Time Spent: 20m
> Remaining Estimate: 0h
>
> Compressors and Decompressions with a @DoNotPool annotation are not closed
> when they are returned to the CodecPool, which causes a native memory leak.
>
> I have included a link to a [Demo
> Project|https://github.com/kevins-29/hadoop-gzip-memory-leak] demonstrating
> the leak
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]