-
- Downloads
[SPARK-9419] ShuffleMemoryManager and MemoryStore should track memory on a...
[SPARK-9419] ShuffleMemoryManager and MemoryStore should track memory on a per-task, not per-thread, basis Spark's ShuffleMemoryManager and MemoryStore track memory on a per-thread basis, which causes problems in the handful of cases where we have tasks that use multiple threads. In PythonRDD, RRDD, ScriptTransformation, and PipedRDD we consume the input iterator in a separate thread in order to write it to an external process. As a result, these RDD's input iterators are consumed in a different thread than the thread that created them, which can cause problems in our memory allocation tracking. For example, if allocations are performed in one thread but deallocations are performed in a separate thread then memory may be leaked or we may get errors complaining that more memory was allocated than was freed. I think that the right way to fix this is to change our accounting to be performed on a per-task instead of per-thread basis. Note that the current per-thread tracking has caused problems in the past; SPARK-3731 (#2668) fixes a memory leak in PythonRDD that was caused by this issue (that fix is no longer necessary as of this patch). Author: Josh Rosen <joshrosen@databricks.com> Closes #7734 from JoshRosen/memory-tracking-fixes and squashes the following commits: b4b1702 [Josh Rosen] Propagate TaskContext to writer threads. 57c9b4e [Josh Rosen] Merge remote-tracking branch 'origin/master' into memory-tracking-fixes ed25d3b [Josh Rosen] Address minor PR review comments 44f6497 [Josh Rosen] Fix long line. 7b0f04b [Josh Rosen] Fix ShuffleMemoryManagerSuite f57f3f2 [Josh Rosen] More thread -> task changes fa78ee8 [Josh Rosen] Move Executor's cleanup into Task so that TaskContext is defined when cleanup is performed 5e2f01e [Josh Rosen] Fix capitalization 1b0083b [Josh Rosen] Roll back fix in PySpark, which is no longer necessary 2e1e0f8 [Josh Rosen] Use TaskAttemptIds to track shuffle memory c9e8e54 [Josh Rosen] Use TaskAttemptIds to track unroll memory
Showing
- core/src/main/scala/org/apache/spark/api/python/PythonRDD.scala 1 addition, 5 deletions...rc/main/scala/org/apache/spark/api/python/PythonRDD.scala
- core/src/main/scala/org/apache/spark/api/r/RRDD.scala 2 additions, 0 deletionscore/src/main/scala/org/apache/spark/api/r/RRDD.scala
- core/src/main/scala/org/apache/spark/executor/Executor.scala 0 additions, 4 deletionscore/src/main/scala/org/apache/spark/executor/Executor.scala
- core/src/main/scala/org/apache/spark/rdd/PipedRDD.scala 1 addition, 0 deletionscore/src/main/scala/org/apache/spark/rdd/PipedRDD.scala
- core/src/main/scala/org/apache/spark/scheduler/Task.scala 13 additions, 2 deletionscore/src/main/scala/org/apache/spark/scheduler/Task.scala
- core/src/main/scala/org/apache/spark/shuffle/ShuffleMemoryManager.scala 47 additions, 41 deletions...scala/org/apache/spark/shuffle/ShuffleMemoryManager.scala
- core/src/main/scala/org/apache/spark/storage/MemoryStore.scala 51 additions, 44 deletions...src/main/scala/org/apache/spark/storage/MemoryStore.scala
- core/src/test/scala/org/apache/spark/shuffle/ShuffleMemoryManagerSuite.scala 27 additions, 14 deletions.../org/apache/spark/shuffle/ShuffleMemoryManagerSuite.scala
- core/src/test/scala/org/apache/spark/storage/BlockManagerSuite.scala 42 additions, 42 deletions...st/scala/org/apache/spark/storage/BlockManagerSuite.scala
Loading
Please register or sign in to comment