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

Pass "cached" blocks directly to disk if memory is not large enough

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.1.0
    • Component/s: Spark Core
    • Labels:
      None

      Description

      Currently in Spark we entirely unroll a partition and then check whether it will cause us to exceed the storage limit. This has an obvious problem - if the partition itself is enough to push us over the storage limit (and eventually over the JVM heap), it will cause an OOM.

      This can happen in cases where a single partition is very large or when someone is running examples locally with a small heap.

      https://github.com/apache/spark/blob/f6ff2a61d00d12481bfb211ae13d6992daacdcc2/core/src/main/scala/org/apache/spark/CacheManager.scala#L148

      We should think a bit about the most elegant way to fix this - it shares some similarities with the external aggregation code.

      A simple idea is to periodically check the size of the buffer as we are unrolling and see if we are over the memory limit. If we are we could prepend the existing buffer to the iterator and write that entire thing out to disk.

        Attachments

        1. spark-1777-design-doc.pdf
          118 kB
          Andrew Or

          Issue Links

            Activity

              People

              • Assignee:
                andrewor14 Andrew Or
                Reporter:
                pwendell Patrick Wendell
              • Votes:
                0 Vote for this issue
                Watchers:
                8 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: