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

    https://github.com/apache/spark/pull/21322#discussion_r224875111
  
    --- Diff: 
core/src/main/scala/org/apache/spark/storage/memory/MemoryStore.scala ---
    @@ -384,15 +385,30 @@ private[spark] class MemoryStore(
         }
       }
     
    +  private def maybeReleaseResources(resource: (BlockId, MemoryEntry[_])): 
Unit = {
    +    maybeReleaseResources(resource._1, resource._2)
    +  }
    +
    +  private def maybeReleaseResources(blockId: BlockId, entry: 
MemoryEntry[_]): Unit = {
    +    entry match {
    +      case SerializedMemoryEntry(buffer, _, _) => buffer.dispose()
    --- End diff --
    
    Why not just make these case classes `Closeable` and then you can close 
them consistently


---

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

Reply via email to