hadoop-common-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Anu Engineer (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HADOOP-11526) Memory leak in Bzip2Decompressor
Date Wed, 04 Feb 2015 01:19:35 GMT

    [ https://issues.apache.org/jira/browse/HADOOP-11526?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14304441#comment-14304441
] 

Anu Engineer commented on HADOOP-11526:
---------------------------------------

looks like this test failure is not related to code change:
Code change avoids a memory leak in native code and should not effect this code path. This
is probably a race condition in tests.

Error Message

Address already in use
Stacktrace

java.net.BindException: Address already in use
	at sun.nio.ch.Net.bind0(Native Method)
	at sun.nio.ch.Net.bind(Net.java:444)
	at sun.nio.ch.Net.bind(Net.java:436)
	at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:214)

> Memory leak in Bzip2Decompressor
> --------------------------------
>
>                 Key: HADOOP-11526
>                 URL: https://issues.apache.org/jira/browse/HADOOP-11526
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: io
>            Reporter: Ian Rogers
>            Assignee: Anu Engineer
>         Attachments: HADOOP-11526.001.patch
>
>
> The use of JNI's GetStringUTFChars should be paired with ReleaseStringUTFChars or else
the utf-8 char* created by Java's JNI implementation is leaked. It isn't in Bzip2Decompressor.c:
> https://apache.googlesource.com/hadoop-common/+/refs/heads/trunk/hadoop-common-project/hadoop-common/src/main/native/src/org/apache/hadoop/io/compress/bzip2/Bzip2Decompressor.c#45
> A less error-prone way of handling JNI resources like local references and UTF strings
is to use a smart pointer like the Apache licensed code in Android's ScopedLocalRef and ScopedUtfChars:
> https://android.googlesource.com/platform/libnativehelper/+/jb-mr1.1-dev-plus-aosp/include/nativehelper/ScopedLocalRef.h
> https://android.googlesource.com/platform/libnativehelper/+/jb-mr1.1-dev-plus-aosp/include/nativehelper/ScopedUtfChars.h



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

Mime
View raw message