Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-22062

BlockManager does not account for memory consumed by remote fetches

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 2.2.0
    • 2.3.0
    • Block Manager, Spark Core
    • None

    Description

      We use Spark exclusively with StorageLevel.DiskOnly as our workloads are very sensitive to memory usage. Recently, we've spotted that the jobs sometimes OOM leaving lots of byte[] arrays on the heap. Upon further investigation, we've found that the arrays come from BlockManager.getRemoteBytes, which calls BlockTransferService.fetchBlockSync, which in its turn would allocate an on-heap ByteBuffer of the same size as the block (e.g. full partition), if the block was successfully retrieved over the network.

      This memory is not accounted towards Spark storage/execution memory and could potentially lead to OOM if BlockManager fetches too many partitions in parallel. I wonder if this is intentional behaviour, or in fact a bug?

      Attachments

        Issue Links

          Activity

            People

              jerryshao Saisai Shao
              lebedev Sergei Lebedev
              Votes:
              0 Vote for this issue
              Watchers:
              9 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: