Github user ConeyLiu commented on a diff in the pull request:

    https://github.com/apache/spark/pull/19316#discussion_r144169752
  
    --- Diff: 
core/src/main/scala/org/apache/spark/storage/memory/MemoryStore.scala ---
    @@ -388,7 +388,13 @@ private[spark] class MemoryStore(
         // perform one final call to attempt to allocate additional memory if 
necessary.
         if (keepUnrolling) {
           serializationStream.close()
    -      reserveAdditionalMemoryIfNecessary()
    +      if (bbos.size > unrollMemoryUsedByThisBlock) {
    +        val amountToRequest = bbos.size - unrollMemoryUsedByThisBlock
    --- End diff --
    
    Because we request `val amountToRequest = (bbos.size * memoryGrowthFactor - 
unrollMemoryUsedByThisBlock).toLong` in `reserveAdditionalMemoryIfNecessary ` 
to avoid requesting for every records.  But here we just need request the 
precise memory for the last request.


---

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

Reply via email to