Details
-
Bug
-
Status: Closed
-
Blocker
-
Resolution: Fixed
-
0.20.1
-
None
-
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.
-
Reviewed
-
Memory leak in function hdfsFreeFileInfo in libhdfs. This bug affects fuse-dfs severely.
-
memory leak libhdfs hdfsFreeFileInfo fuse-dfs
Description
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)
}
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!
Attachments
Attachments
Issue Links
- relates to
-
HDFS-773 libhdfs test for memory leaks
- Open