Return-Path: Delivered-To: apmail-hadoop-hdfs-issues-archive@minotaur.apache.org Received: (qmail 82505 invoked from network); 5 Sep 2009 03:16:20 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 5 Sep 2009 03:16:20 -0000 Received: (qmail 47134 invoked by uid 500); 5 Sep 2009 03:16:20 -0000 Delivered-To: apmail-hadoop-hdfs-issues-archive@hadoop.apache.org Received: (qmail 47076 invoked by uid 500); 5 Sep 2009 03:16:20 -0000 Mailing-List: contact hdfs-issues-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: hdfs-issues@hadoop.apache.org Delivered-To: mailing list hdfs-issues@hadoop.apache.org Received: (qmail 47066 invoked by uid 99); 5 Sep 2009 03:16:20 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 05 Sep 2009 03:16:20 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 05 Sep 2009 03:16:17 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 74114234C004 for ; Fri, 4 Sep 2009 20:15:57 -0700 (PDT) Message-ID: <28470935.1252120557461.JavaMail.jira@brutus> Date: Fri, 4 Sep 2009 20:15:57 -0700 (PDT) From: "Zhang Bingjun (JIRA)" To: hdfs-issues@hadoop.apache.org Subject: [jira] Commented: (HDFS-596) Memory leak in libhdfs: hdfsFreeFileInfo() in libhdfs does not free memory for mOwner and mGroup In-Reply-To: <1895823210.1252052697759.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/HDFS-596?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12751695#action_12751695 ] Zhang Bingjun commented on HDFS-596: ------------------------------------ Thanks to Boudnik! > Memory leak in libhdfs: hdfsFreeFileInfo() in libhdfs does not free memory for mOwner and mGroup > ------------------------------------------------------------------------------------------------ > > Key: HDFS-596 > URL: https://issues.apache.org/jira/browse/HDFS-596 > Project: Hadoop HDFS > Issue Type: Bug > Components: contrib/fuse-dfs > Affects Versions: 0.20.1 > Environment: Linux hadoop-001 2.6.28-14-server #47-Ubuntu SMP Sat Jul 25 01:18:34 UTC 2009 i686 GNU/Linux. Namenode with 1GB memory. > Reporter: Zhang Bingjun > Priority: Critical > Fix For: 0.20.1 > > Attachments: HDFS-596.patch > > Original Estimate: 0.5h > Remaining Estimate: 0.5h > > This bugs affects fuse-dfs severely. In my test, about 1GB memory were exhausted and the fuse-dfs mount directory was disconnected after writing 14000 files. This bug is related to the memory leak problem of this issue: http://issues.apache.org/jira/browse/HDFS-420. > The bug can be fixed very easily. In function hdfsFreeFileInfo() in file hdfs.c (under c++/libhdfs/) change code block: > //Free the mName > int i; > for (i=0; i < numEntries; ++i) { > if (hdfsFileInfo[i].mName) { > free(hdfsFileInfo[i].mName); > } > } > into: > // free mName, mOwner and mGroup > int i; > for (i=0; i < numEntries; ++i) { > if (hdfsFileInfo[i].mName) { > free(hdfsFileInfo[i].mName); > } > if (hdfsFileInfo[i].mOwner){ > free(hdfsFileInfo[i].mOwner); > } > if (hdfsFileInfo[i].mGroup){ > free(hdfsFileInfo[i].mGroup); > } > } > I am new to Jira and haven't figured out a way to generate .patch file yet. Could anyone help me do that so that others can commit the changes into the code base. Thanks! -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.