Uh oh!
There was an error while loading. Please reload this page.
[SPARK-14560] Spillables can be forced to spill after inserting all data, to avoid OOM - #12369
[SPARK-14560] Spillables can be forced to spill after inserting all data, to avoid OOM#12369squito wants to merge 5 commits into
Conversation
SparkQA
commented
Apr 13, 2016
Test build #55742 has finished for PR 12369 at commit
|
SparkQA
commented
Apr 13, 2016
Test build #55743 has finished for PR 12369 at commit
|
squito
commented
Apr 14, 2016
cc @JoshRosen@davies , i think you have looked at related parts of memory management recently |
davies
commented
Apr 15, 2016
�LGTM over all, @JoshRosen do you want to take another look? |
lianhuiwang
commented
Apr 18, 2016
I think you can take a look at #10024 . It can force ExternalAppendOnlyMap or ExternalSorter to spill memory when there is no enough memory. Thanks. |
squito
commented
Apr 18, 2016
Thanks for the review @davies. I actually just found out about another workload failure even with this patch -- not sure if its related or not, but I'll look into today and will update, so lets hold off on merging for the moment in any case. @lianhuiwang sorry I wasn't aware of your PR earlier. I totally agree that it makes more sense to have Spillables actually spill when requested by a MemoryConsumer. However as that change is more invasive and risky, I still think it makes sense to put this in for now as a safe, easy fix for now. If that later patch completely removes the need for this, that would be fantastic. I'll take a look at your patch as well. |
SparkQA
commented
Apr 18, 2016
Test build #56107 has finished for PR 12369 at commit
|
What changes were proposed in this pull request?
This adds a new configuration,
spark.shuffle.spillAfterRead, which can be used to forceSpillables to spill their contents after all records have been inserted. The default is false, to keep previous behavior and avoid a performance penalty when unnecessary. However this needed in cases to prevent an OOM when oneSpillableacquires all of the execution memory available for a task, thus leaving no memory available for any other operations in the same task.This also required some small refactoring of
Spillableto support a forced spill from an external request (as opposed to not having enough memory as records are added).I was initially hoping to limit the places where we needed to spill -- I thought that it would only be in a
ShuffleMapTaskwhich also does a shuffle-read. In that case there is clearly aSpillableon both the shuffle-read and shuffle-write side. However, I realized this wasn't sufficient -- there are other cases when you can have multipleSpillables, eg if you use a common partitioner across several aggregations, which will get pipelined into one stage.This also makes
Spillables register themselves asMemoryConsumers with theTaskMemoryManager. Note that this does not lead to cooperative memory management forSpillables -- the only reason for this is to improve the logging around memory usage. Before this change, there would be messages like:instead, with this change the logs report the memory as being associated with the corresponing
SpillableHow was this patch tested?