aboutsummaryrefslogtreecommitdiff
path: root/graphx/src
diff options
context:
space:
mode:
authorAnkur Dave <ankurdave@gmail.com>2014-06-05 17:45:38 -0700
committerReynold Xin <rxin@apache.org>2014-06-05 17:45:38 -0700
commit9bad0b73722fb359f14db864e69aa7efde3588c5 (patch)
tree29510877539ba4481a354247ee6ced6db0d6c7ff /graphx/src
parent3d3f8c8004da110ca97973119e9d9f04f878ee81 (diff)
downloadspark-9bad0b73722fb359f14db864e69aa7efde3588c5.tar.gz
spark-9bad0b73722fb359f14db864e69aa7efde3588c5.tar.bz2
spark-9bad0b73722fb359f14db864e69aa7efde3588c5.zip
[SPARK-2025] Unpersist edges of previous graph in Pregel
Due to a bug introduced by apache/spark#497, Pregel does not unpersist replicated vertices from previous iterations. As a result, they stay cached until memory is full, wasting GC time. This PR corrects the problem by unpersisting both the edges and the replicated vertices of previous iterations. This is safe because the edges and replicated vertices of the current iteration are cached by the call to `g.cache()` and then materialized by the call to `messages.count()`. Therefore no unmaterialized RDDs depend on `prevG.edges`. I verified that no recomputation occurs by running PageRank with a custom patch to Spark that warns when a partition is recomputed. Thanks to Tim Weninger for reporting this bug. Author: Ankur Dave <ankurdave@gmail.com> Closes #972 from ankurdave/SPARK-2025 and squashes the following commits: 13d5b07 [Ankur Dave] Unpersist edges of previous graph in Pregel
Diffstat (limited to 'graphx/src')
-rw-r--r--graphx/src/main/scala/org/apache/spark/graphx/Pregel.scala1
1 files changed, 1 insertions, 0 deletions
diff --git a/graphx/src/main/scala/org/apache/spark/graphx/Pregel.scala b/graphx/src/main/scala/org/apache/spark/graphx/Pregel.scala
index 4572eab287..5e55620147 100644
--- a/graphx/src/main/scala/org/apache/spark/graphx/Pregel.scala
+++ b/graphx/src/main/scala/org/apache/spark/graphx/Pregel.scala
@@ -150,6 +150,7 @@ object Pregel extends Logging {
oldMessages.unpersist(blocking=false)
newVerts.unpersist(blocking=false)
prevG.unpersistVertices(blocking=false)
+ prevG.edges.unpersist(blocking=false)
// count the iteration
i += 1
}