Repository: spark
Updated Branches:
  refs/heads/master 246cb3f15 -> 2bd812639


[SPARK-1777 (partial)] bugfix: make size of requested memory correctly

Author: Zhang, Liye <[email protected]>

Closes #1892 from liyezhang556520/lazy_memory_request and squashes the 
following commits:

335ab61 [Zhang, Liye] [SPARK-1777 (partial)] bugfix: make size of requested 
memory correctly


Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/2bd81263
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/2bd81263
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/2bd81263

Branch: refs/heads/master
Commit: 2bd812639c3d8c62a725fb7577365ef0816f2898
Parents: 246cb3f
Author: Zhang, Liye <[email protected]>
Authored: Tue Aug 12 23:43:36 2014 -0700
Committer: Reynold Xin <[email protected]>
Committed: Tue Aug 12 23:43:36 2014 -0700

----------------------------------------------------------------------
 core/src/main/scala/org/apache/spark/storage/MemoryStore.scala | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/spark/blob/2bd81263/core/src/main/scala/org/apache/spark/storage/MemoryStore.scala
----------------------------------------------------------------------
diff --git a/core/src/main/scala/org/apache/spark/storage/MemoryStore.scala 
b/core/src/main/scala/org/apache/spark/storage/MemoryStore.scala
index 28f675c..0a09c24 100644
--- a/core/src/main/scala/org/apache/spark/storage/MemoryStore.scala
+++ b/core/src/main/scala/org/apache/spark/storage/MemoryStore.scala
@@ -238,7 +238,7 @@ private[spark] class MemoryStore(blockManager: 
BlockManager, maxMemory: Long)
           // If our vector's size has exceeded the threshold, request more 
memory
           val currentSize = vector.estimateSize()
           if (currentSize >= memoryThreshold) {
-            val amountToRequest = (currentSize * (memoryGrowthFactor - 
1)).toLong
+            val amountToRequest = (currentSize * memoryGrowthFactor - 
memoryThreshold).toLong
             // Hold the accounting lock, in case another thread concurrently 
puts a block that
             // takes up the unrolling space we just ensured here
             accountingLock.synchronized {
@@ -254,7 +254,7 @@ private[spark] class MemoryStore(blockManager: 
BlockManager, maxMemory: Long)
               }
             }
             // New threshold is currentSize * memoryGrowthFactor
-            memoryThreshold = currentSize + amountToRequest
+            memoryThreshold += amountToRequest
           }
         }
         elementsUnrolled += 1


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to