Uploaded image for project: 'Hadoop HDFS'
  1. Hadoop HDFS
  2. HDFS-8896

DataNode object isn't GCed when shutdown, because it has GC root in ShutdownHookManager

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.8.0, 3.0.0-alpha1
    • Component/s: test
    • Labels:
      None
    • Hadoop Flags:
      Reviewed

      Description

      The anonymous Thread object created in ShutdownHookManager is a GC root.
      screenshot_1 shows how DN object be traced to the GC root.

      It's not a problem in production.
      It's a problem in test, especially when MiniDFSCluster starts/shutdowns many DNs, which could cause OutOfMemoryError.
      screenshot_2 shows many DN objects are not GCed when run the test of HDFS-8838.

        Attachments

        1. HDFS-8896.01.patch
          2 kB
          Walter Su
        2. screenshot_2.PNG
          3 kB
          Walter Su
        3. screenshot_1.PNG
          38 kB
          Walter Su

          Issue Links

            Activity

              People

              • Assignee:
                walter.k.su Walter Su
                Reporter:
                walter.k.su Walter Su
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: