Github user cloud-fan commented on the pull request:

    https://github.com/apache/spark/pull/791#issuecomment-55356385
  
    First, `ensureFreeSpace`(I renamed it to `findToBeDroppedBlocks`) doesn't 
always return true. If it can't find enough to-be-dropped blocks to "free 
space", it will return false. 
    Then if `ensureFreeSpace` return true, you can regard it as return a 
`Future` that PROMISE you it will free a certain amount of memory after you 
finish that `Future`. At that moment, the `freeMemory` is not updated(means the 
memory has not been freed yet) until you finish the `Future`.
    So if  we put new blocks faster than the old blocks are dropped, 
`ensureFreeSpace` will return false(because there is not enough memory), then 
no to-be-dropped block is added, that thread will put that block into disk 
store.


---
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