Hadoop Map/Reduce
  1. Hadoop Map/Reduce
  2. MAPREDUCE-4301

Dedupe some strings in MRAM for memory savings

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 0.23.3, 2.0.0-alpha
    • Fix Version/s: 0.23.3, 2.0.2-alpha
    • Component/s: applicationmaster
    • Labels:
      None

      Description

      Recently an OutOfMemoryError caused one of our jobs to become a zombie (MAPREDUCE-4300). It was a rather large job with 78000+ map tasks and only 750MB of heap configured. I took a heap dump to see if there were any obvious memory leaks, and I could not find any, but yourkit and some digging found some potential memory optimizations that we could do.

      In this particular case we could save about 20MB if SplitMetaInfoReader.readSplitMetaInfo only computed the JobSplitFile once instead of for each split. (a 2 line change)

      I will look into some others and see if there are more savings I can come up with.

      1. MR-4301.txt
        2 kB
        Robert Joseph Evans

        Activity

        Hide
        Robert Joseph Evans added a comment -

        This patch is a small safe one that only covers the JobSplit.

        I looked at several other strings that also had a lot of duplicates.

        TaskAttemptStatusUpdateEvent$TaskAttemptState.stateString
        MapTaskAttemptImpl.diagnostics
        The keys to Counters.groups
        GenericGroup.displayName
        The keys to GenericGroup.counters
        and GenericCounter.displayName

        None of the rest of these were as simple to solve because they all seem to ultimate result from either incoming RPC messages or from a parsed file. The only way to fix these is to try and dedupe them on the fly. This can be done with String.intern, but at the risk of filling up the permgen space. Or with playing games with our own internal cache.

        Either of these solutions is much more risky then just a two line change so I will file a separate JIRA to explore those options.

        Show
        Robert Joseph Evans added a comment - This patch is a small safe one that only covers the JobSplit. I looked at several other strings that also had a lot of duplicates. TaskAttemptStatusUpdateEvent$TaskAttemptState.stateString MapTaskAttemptImpl.diagnostics The keys to Counters.groups GenericGroup.displayName The keys to GenericGroup.counters and GenericCounter.displayName None of the rest of these were as simple to solve because they all seem to ultimate result from either incoming RPC messages or from a parsed file. The only way to fix these is to try and dedupe them on the fly. This can be done with String.intern, but at the risk of filling up the permgen space. Or with playing games with our own internal cache. Either of these solutions is much more risky then just a two line change so I will file a separate JIRA to explore those options.
        Hide
        Hadoop QA added a comment -

        -1 overall. Here are the results of testing the latest attachment
        http://issues.apache.org/jira/secure/attachment/12530589/MR-4301.txt
        against trunk revision .

        +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 new tests are needed for this patch.
        Also please list what manual steps were performed to verify this patch.

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

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

        +1 eclipse:eclipse. The patch built with eclipse:eclipse.

        +1 findbugs. The patch does not introduce any new Findbugs (version 1.3.9) warnings.

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

        +1 core tests. The patch passed unit tests in hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core.

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

        Test results: https://builds.apache.org/job/PreCommit-MAPREDUCE-Build/2431//testReport/
        Console output: https://builds.apache.org/job/PreCommit-MAPREDUCE-Build/2431//console

        This message is automatically generated.

        Show
        Hadoop QA added a comment - -1 overall. Here are the results of testing the latest attachment http://issues.apache.org/jira/secure/attachment/12530589/MR-4301.txt against trunk revision . +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 new tests are needed for this patch. Also please list what manual steps were performed to verify this patch. +1 javac. The applied patch does not increase the total number of javac compiler warnings. +1 javadoc. The javadoc tool did not generate any warning messages. +1 eclipse:eclipse. The patch built with eclipse:eclipse. +1 findbugs. The patch does not introduce any new Findbugs (version 1.3.9) warnings. +1 release audit. The applied patch does not increase the total number of release audit warnings. +1 core tests. The patch passed unit tests in hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core. +1 contrib tests. The patch passed contrib unit tests. Test results: https://builds.apache.org/job/PreCommit-MAPREDUCE-Build/2431//testReport/ Console output: https://builds.apache.org/job/PreCommit-MAPREDUCE-Build/2431//console This message is automatically generated.
        Hide
        Thomas Graves added a comment -

        +1 Thanks Bobby. I committed this to trunk, branch-2, and branch-23

        Show
        Thomas Graves added a comment - +1 Thanks Bobby. I committed this to trunk, branch-2, and branch-23
        Hide
        Hudson added a comment -

        Integrated in Hadoop-Hdfs-trunk-Commit #2389 (See https://builds.apache.org/job/Hadoop-Hdfs-trunk-Commit/2389/)
        MAPREDUCE-4301. Dedupe some strings in MRAM for memory savings (bobby via tgraves) (Revision 1346002)

        Result = SUCCESS
        tgraves : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1346002
        Files :

        • /hadoop/common/trunk/hadoop-mapreduce-project/CHANGES.txt
        • /hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/split/SplitMetaInfoReader.java
        Show
        Hudson added a comment - Integrated in Hadoop-Hdfs-trunk-Commit #2389 (See https://builds.apache.org/job/Hadoop-Hdfs-trunk-Commit/2389/ ) MAPREDUCE-4301 . Dedupe some strings in MRAM for memory savings (bobby via tgraves) (Revision 1346002) Result = SUCCESS tgraves : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1346002 Files : /hadoop/common/trunk/hadoop-mapreduce-project/CHANGES.txt /hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/split/SplitMetaInfoReader.java
        Hide
        Hudson added a comment -

        Integrated in Hadoop-Common-trunk-Commit #2317 (See https://builds.apache.org/job/Hadoop-Common-trunk-Commit/2317/)
        MAPREDUCE-4301. Dedupe some strings in MRAM for memory savings (bobby via tgraves) (Revision 1346002)

        Result = SUCCESS
        tgraves : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1346002
        Files :

        • /hadoop/common/trunk/hadoop-mapreduce-project/CHANGES.txt
        • /hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/split/SplitMetaInfoReader.java
        Show
        Hudson added a comment - Integrated in Hadoop-Common-trunk-Commit #2317 (See https://builds.apache.org/job/Hadoop-Common-trunk-Commit/2317/ ) MAPREDUCE-4301 . Dedupe some strings in MRAM for memory savings (bobby via tgraves) (Revision 1346002) Result = SUCCESS tgraves : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1346002 Files : /hadoop/common/trunk/hadoop-mapreduce-project/CHANGES.txt /hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/split/SplitMetaInfoReader.java
        Hide
        Hudson added a comment -

        Integrated in Hadoop-Mapreduce-trunk-Commit #2335 (See https://builds.apache.org/job/Hadoop-Mapreduce-trunk-Commit/2335/)
        MAPREDUCE-4301. Dedupe some strings in MRAM for memory savings (bobby via tgraves) (Revision 1346002)

        Result = FAILURE
        tgraves : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1346002
        Files :

        • /hadoop/common/trunk/hadoop-mapreduce-project/CHANGES.txt
        • /hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/split/SplitMetaInfoReader.java
        Show
        Hudson added a comment - Integrated in Hadoop-Mapreduce-trunk-Commit #2335 (See https://builds.apache.org/job/Hadoop-Mapreduce-trunk-Commit/2335/ ) MAPREDUCE-4301 . Dedupe some strings in MRAM for memory savings (bobby via tgraves) (Revision 1346002) Result = FAILURE tgraves : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1346002 Files : /hadoop/common/trunk/hadoop-mapreduce-project/CHANGES.txt /hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/split/SplitMetaInfoReader.java
        Hide
        Hudson added a comment -

        Integrated in Hadoop-Hdfs-trunk #1067 (See https://builds.apache.org/job/Hadoop-Hdfs-trunk/1067/)
        MAPREDUCE-4301. Dedupe some strings in MRAM for memory savings (bobby via tgraves) (Revision 1346002)

        Result = SUCCESS
        tgraves : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1346002
        Files :

        • /hadoop/common/trunk/hadoop-mapreduce-project/CHANGES.txt
        • /hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/split/SplitMetaInfoReader.java
        Show
        Hudson added a comment - Integrated in Hadoop-Hdfs-trunk #1067 (See https://builds.apache.org/job/Hadoop-Hdfs-trunk/1067/ ) MAPREDUCE-4301 . Dedupe some strings in MRAM for memory savings (bobby via tgraves) (Revision 1346002) Result = SUCCESS tgraves : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1346002 Files : /hadoop/common/trunk/hadoop-mapreduce-project/CHANGES.txt /hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/split/SplitMetaInfoReader.java
        Hide
        Hudson added a comment -

        Integrated in Hadoop-Hdfs-0.23-Build #278 (See https://builds.apache.org/job/Hadoop-Hdfs-0.23-Build/278/)
        merge -r 1346002:1346003 from branch-2. FIXES: MAPREDUCE-4301 (Revision 1346004)

        Result = SUCCESS
        tgraves : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1346004
        Files :

        • /hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/CHANGES.txt
        • /hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/split/SplitMetaInfoReader.java
        Show
        Hudson added a comment - Integrated in Hadoop-Hdfs-0.23-Build #278 (See https://builds.apache.org/job/Hadoop-Hdfs-0.23-Build/278/ ) merge -r 1346002:1346003 from branch-2. FIXES: MAPREDUCE-4301 (Revision 1346004) Result = SUCCESS tgraves : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1346004 Files : /hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/CHANGES.txt /hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/split/SplitMetaInfoReader.java
        Hide
        Hudson added a comment -

        Integrated in Hadoop-Mapreduce-trunk #1101 (See https://builds.apache.org/job/Hadoop-Mapreduce-trunk/1101/)
        MAPREDUCE-4301. Dedupe some strings in MRAM for memory savings (bobby via tgraves) (Revision 1346002)

        Result = FAILURE
        tgraves : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1346002
        Files :

        • /hadoop/common/trunk/hadoop-mapreduce-project/CHANGES.txt
        • /hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/split/SplitMetaInfoReader.java
        Show
        Hudson added a comment - Integrated in Hadoop-Mapreduce-trunk #1101 (See https://builds.apache.org/job/Hadoop-Mapreduce-trunk/1101/ ) MAPREDUCE-4301 . Dedupe some strings in MRAM for memory savings (bobby via tgraves) (Revision 1346002) Result = FAILURE tgraves : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1346002 Files : /hadoop/common/trunk/hadoop-mapreduce-project/CHANGES.txt /hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/split/SplitMetaInfoReader.java

          People

          • Assignee:
            Robert Joseph Evans
            Reporter:
            Robert Joseph Evans
          • Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development