azagrebin commented on issue #11109: [FLINK-15758][MemManager] Release segment 
and its unsafe memory in GC Cleaner
URL: https://github.com/apache/flink/pull/11109#issuecomment-587408504
 
 
   @StephanEwen 
   
   Not sure, these changes are directly related to the warnings. The 
`HybridMemorySegment` and the GC cleaner of its unsafe memory does not strictly 
need `java.nio.ByteBuffer`s. It could be any other object handle (just private 
`Object` or `HybridMemorySegment` itself) which reference is kept in java code.
   
   We illegally use the private constructor mostly to convert the unsafe 
`HybridMemorySegment` to the `java.nio.ByteBuffer` API in 
`HybridMemorySegment#getOffHeapBuffer` and `HybridMemorySegment#wrap` for 
network and file IO. This is the root case. An alternative to the private 
constructor could be our internal implementation of `java.nio.ByteBuffer`, 
which could be similar to `DirectByteBuffer`.

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


With regards,
Apache Git Services

Reply via email to