Xinyu Tan created RATIS-2065:
--------------------------------
Summary: Avoid the out-of-heap memory OOM phenomenon of frequent
creation and deletion of Raft group scenarios
Key: RATIS-2065
URL: https://issues.apache.org/jira/browse/RATIS-2065
Project: Ratis
Issue Type: Improvement
Reporter: Xinyu Tan
Assignee: Xinyu Tan
The current SegmentedRaftLogWorker will create one when it's created
[DirectBuffer|https://github.com/apache/ratis/blob/master/ratis-server/src/main/java/org/apache/ratis/server/raftlog/segmented/SegmentedRaftLogWorker.java#L209],
in the end will not take the initiative to release it. This requires the
corresponding in-heap memory to be released by the GC before the corresponding
off-heap memory can be freed.
For frequent Raft Group creation and deletion scenarios, there may be plenty of
in-heap memory that will not trigger GC, but the out-of-heap memory will be
occupied by these deprecated DirectBuffers, and the out-of-heap memory OOM
phenomenon will eventually occur.
In IoTDB, We will
[explicitly|https://github.com/apache/iotdb/blob/master/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/utils/MmapUtil.java#L33]
release outside the heap memory, thus avoiding a similar situation.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)