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

    https://github.com/apache/spark/pull/3629#discussion_r25046037
  
    --- Diff: core/src/main/scala/org/apache/spark/storage/MemoryStore.scala ---
    @@ -283,12 +284,13 @@ private[spark] class MemoryStore(blockManager: 
BlockManager, maxMemory: Long)
           }
     
         } finally {
    -      // If we return an array, the values returned do not depend on the 
underlying vector and
    -      // we can immediately free up space for other threads. Otherwise, if 
we return an iterator,
    +      // If we return an array, the values returned will be used in 
tryToPut()
    +      // and finally put into memoryStore.entrys, so we pending unroll 
memory
    +      // for this thread and release it in tryToPut(). Otherwise, if we 
return an iterator,
           // we release the memory claimed by this thread later on when the 
task finishes.
    --- End diff --
    
    I would rephrase this whole paragraph as follows:
    ```
    // If we return an array, the values returned will later be cached in 
`tryToPut`.
    // In this case, we should release the memory after we cache the block 
there.
    // Otherwise, if we return an iterator, we release the memory reserved here
    // later when the task finishes.
    ```


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

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

Reply via email to