xuechendi opened a new pull request #32534:
URL: https://github.com/apache/spark/pull/32534


   This PR is proposing a add-on to support to manual close entries in 
MemoryStore and InMemoryRelation
   
   ### What changes were proposed in this pull request?
   Currently:
       MemoryStore uses a LinkedHashMap[BlockId, MemoryEntry[_]] to store all 
OnHeap or OffHeap entries.
   And when memoryStore.remove(blockId) is called, codes will simply remove one 
entry from LinkedHashMap and leverage Java GC to do release work.
   
   This PR:
       We are proposing a add-on to manually close any object stored in 
MemoryStore and InMemoryRelation if this object is extended from AutoCloseable.
   
   Veifiication:
       In our own use case, we implemented a user-defined off-heap-hashRelation 
for BHJ, and we verified that by adding this manual close, we can make sure our 
defined off-heap-hashRelation can be released when evict is called.
       Also, we implemented user-defined cachedBatch and will be release when 
InMemoryRelation.clearCache() is called by this PR 
   
   
   ### Why are the changes needed?
   This changes can help to clean some off-heap user-defined object may be 
cached in InMemoryRelation or MemoryStore
   
   
   ### Does this PR introduce _any_ user-facing change?
   NO
   
   
   ### How was this patch tested?
   WIP
   
   Signed-off-by: Chendi Xue <[email protected]>
   
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]



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

Reply via email to