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

    https://github.com/apache/spark/pull/16499#discussion_r106552361
  
    --- Diff: core/src/main/scala/org/apache/spark/storage/BlockManager.scala 
---
    @@ -1048,7 +1065,7 @@ private[spark] class BlockManager(
               try {
                 replicate(blockId, bytesToReplicate, level, remoteClassTag)
               } finally {
    -            bytesToReplicate.dispose()
    +            bytesToReplicate.unmap()
    --- End diff --
    
    @cloud-fan I explored the approach of making the `MemoryStore` return a 
`ChunkedByteBuffer` that cannot be disposed, however I don't think there's a 
clean way to safely support that behavior. In essence, if the memory manager 
marks a buffer as indisposable when it returns it to the block manager, then 
that buffer cannot be evicted later. Adding additional code to handle this 
other behavior correctly was looking rather messy, and I abandoned the effort.
    
    At this point, I think that explicitly separating `unmap` and `dispose` 
methods is still the best way to resolve this issue.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to