You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2019/01/29 05:37:42 UTC
[GitHub] 10110346 commented on a change in pull request #23679:
[SPARK-23516][CORE] It is unnecessary to transfer unroll memory to storage
memory
10110346 commented on a change in pull request #23679: [SPARK-23516][CORE] It is unnecessary to transfer unroll memory to storage memory
URL: https://github.com/apache/spark/pull/23679#discussion_r251697130
##########
File path: core/src/main/scala/org/apache/spark/storage/memory/MemoryStore.scala
##########
@@ -247,18 +247,18 @@ private[spark] class MemoryStore(
val amountToRequest = size - unrollMemoryUsedByThisBlock
keepUnrolling = reserveUnrollMemoryForThisTask(blockId, amountToRequest, memoryMode)
if (keepUnrolling) {
- unrollMemoryUsedByThisBlock += amountToRequest
+ unrollMemoryUsedByThisBlock = size
}
+ } else if (size < unrollMemoryUsedByThisBlock) {
+ releaseUnrollMemoryForThisTask(memoryMode, unrollMemoryUsedByThisBlock - size)
+ unrollMemoryUsedByThisBlock = size
}
if (keepUnrolling) {
val entry = entryBuilder.build()
- // Synchronize so that transfer is atomic
- memoryManager.synchronized {
- releaseUnrollMemoryForThisTask(memoryMode, unrollMemoryUsedByThisBlock)
- val success = memoryManager.acquireStorageMemory(blockId, entry.size, memoryMode)
- assert(success, "transferring unroll memory to storage memory failed")
- }
+ // In fact, unroll memory is also storage memory, it is unnecessary to
+ // release unroll memory really, and then to get storage memory again.
+ releaseUnrollMemoryForThisTask(memoryMode, unrollMemoryUsedByThisBlock, false)
Review comment:
Yeah,thanks
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org