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

DFSStripedInputStream curStripeBuf is not freed by unbuffer()

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 3.0.0
    • 3.3.0, 3.1.4, 3.2.2
    • ec
    • None

    Description

      Some users of HDFS cache opened HDFS file handles to avoid repeated roundtrips to the NameNode. For example, Impala caches up to 20,000 HDFS file handles by default. Recent tests on erasure coded files show that the open file handles can consume a large amount of memory when not in use.

      For example, here is output from Impala's JMX endpoint when 608 file handles are cached

      {
      "name": "java.nio:type=BufferPool,name=direct",
      "modelerType": "sun.management.ManagementFactoryHelper$1",
      "Name": "direct",
      "TotalCapacity": 1921048960,
      "MemoryUsed": 1921048961,
      "Count": 633,
      "ObjectName": "java.nio:type=BufferPool,name=direct"
      },

      This shows direct buffer memory usage of 3MB per DFSStripedInputStream. Attached is output from Eclipse MAT showing that the direct buffers come from DFSStripedInputStream objects. Both Impala and HBase call unbuffer() when a file handle is being cached and potentially unused for significant chunks of time, yet this shows that the memory remains in use.

      To support caching file handles on erasure coded files, DFSStripedInputStream should avoid holding buffers after the unbuffer() call. See HDFS-7694. "unbuffer()" is intended to move an input stream to a lower memory state to support these caching use cases. In particular, the curStripeBuf seems to be allocated from the BUFFER_POOL on a resetCurStripeBuffer(true) call. It is not freed until close().

      Attachments

        1. ec_heap_dump.png
          419 kB
          Joe McDonnell

        Issue Links

          Activity

            People

              zhaoyim Zhao Yi Ming
              joemcdonnell Joe McDonnell
              Votes:
              0 Vote for this issue
              Watchers:
              13 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: