Issue Details (XML | Word | Printable)

Key: HADOOP-3381
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Raghu Angadi
Reporter: Raghu Angadi
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Hadoop Common

INode interlinks can multiply effect of memory leaks

Created: 13/May/08 06:29 PM   Updated: 08/Jul/09 04:43 PM
Component/s: None
Affects Version/s: 0.16.0
Fix Version/s: 0.18.0

Time Tracking:
Not Specified

File Attachments:
  Size
Text File Licensed for inclusion in ASF works HADOOP-3381.patch 2008-05-16 08:58 PM Raghu Angadi 3 kB
Text File Licensed for inclusion in ASF works HADOOP-3381.patch 2008-05-16 07:21 PM Raghu Angadi 3 kB

Hadoop Flags: Reviewed
Resolution Date: 21/May/08 08:52 PM


 Description  « Hide
Say a directory 'DIR' has a directory tree under it with 10000 files and directories. Each INode keeps refs to parent and children. When DIR is deleted, memory wise we essentially delete link from its parent (and delete the all the blocks from blocksMap). We don't modify its children. This is ok since this will form an island of references and will be gc-ed. Thats when everything is perfect. But if there is a bug that leaves a ref from a valid object (there is a suspect, I will another jira) to even one of these 10000 files, it could hold up all the INode and related objects. This can make a smaller mem leak many times more severe.

 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Tsz Wo (Nicholas), SZE added a comment - 13/May/08 09:04 PM
The INode.parent reference is actually not necessary and waste space. It would be good if we can remove it.

Raghu Angadi added a comment - 13/May/08 09:29 PM
> The INode.parent reference is actually not necessary and waste space. It would be good if we can remove it.

This is related but different issue. I am planning a patch that is suitable for 0.16 and up. Even I thought parent link was removed earlier (to save memory).

Note that parent is not the only culprit. the links to children also have the similar negative effects.

We already iterate over all the files below a directory when it is deleted, so clearing a few more references will be a straight fwd fix.


Raghu Angadi added a comment - 16/May/08 07:21 PM
Attached patch removes the links. Manually verified that even when we revert the fix for HADOOP-3382, only the INode that is directly affected is leaked.

Renamed collectSubtreeBlocks() to collectSubtreeBlocksAndClear() to reflect the change in functionality. Suggestion for better name is welcome.


Lohit Vijayarenu added a comment - 16/May/08 09:37 PM
+1 looks good

Raghu Angadi added a comment - 16/May/08 09:43 PM
This is not a functionality change, rather minimizing effect of memory leaks. I don't think it needs a test case.

Hadoop QA added a comment - 17/May/08 02:38 AM
-1 overall. Here are the results of testing the latest attachment
http://issues.apache.org/jira/secure/attachment/12382217/HADOOP-3381.patch
against trunk revision 656939.

+1 @author. The patch does not contain any @author tags.

-1 tests included. The patch doesn't appear to include any new or modified tests.
Please justify why no tests are needed for this patch.

+1 javadoc. The javadoc tool did not generate any warning messages.

+1 javac. The applied patch does not increase the total number of javac compiler warnings.

+1 findbugs. The patch does not introduce any new Findbugs warnings.

+1 release audit. The applied patch does not increase the total number of release audit warnings.

+1 core tests. The patch passed core unit tests.

+1 contrib tests. The patch passed contrib unit tests.

Test results: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch/2494/testReport/
Findbugs warnings: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch/2494/artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html
Checkstyle results: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch/2494/artifact/trunk/build/test/checkstyle-errors.html
Console output: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch/2494/console

This message is automatically generated.


Raghu Angadi added a comment - 21/May/08 08:52 PM
I just committed this.

Hudson added a comment - 22/May/08 12:24 PM