[
https://issues.apache.org/jira/browse/FLINK-13985?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16927357#comment-16927357
]
Stephan Ewen commented on FLINK-13985:
--------------------------------------
Can you share some details about the exact mechanics?
In particular I would suggest to pay attention to the following aspects:
- Add {{long allocate()}} and {{void release(long)}} to a core util, like
{{MemoryUtils}} to abstract over Unsafe, so that it is easier to deal with the
Unsafe removal later
- Release the memory in the {{free()}} method of the memory segments.
- Add a safety net that frees the memory segments upon garbage collection.
Have a look at how the DirectByteBuffer does it with the cleaners and reference
queues.
> Use native memory for managed memory.
> -------------------------------------
>
> Key: FLINK-13985
> URL: https://issues.apache.org/jira/browse/FLINK-13985
> Project: Flink
> Issue Type: Sub-task
> Reporter: Xintong Song
> Assignee: Andrey Zagrebin
> Priority: Major
>
> * Allocate memory with {{Unsafe.allocateMemory}}
> ** {{MemoryManager}}
> Implement this issue in common code paths for the legacy / new mode. This
> should only affect the GC behavior.
--
This message was sent by Atlassian Jira
(v8.3.2#803003)