[
https://issues.apache.org/jira/browse/RATIS-135?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16240771#comment-16240771
]
Tsz Wo Nicholas Sze commented on RATIS-135:
-------------------------------------------
Good catch Mukul. After applied the patch, TestRaftWithSimulatedRpc fails with
{code}
java.lang.IndexOutOfBoundsException: startIndex = 0, log cache starts from
index 3048
{code}
Please take a look.
Please run all the locally since Jenkins is not yet setup completely.
> Closed segments contribute to leaked memory as eviction policies are not
> honoured
> ---------------------------------------------------------------------------------
>
> Key: RATIS-135
> URL: https://issues.apache.org/jira/browse/RATIS-135
> Project: Ratis
> Issue Type: Bug
> Reporter: Mukul Kumar Singh
> Assignee: Mukul Kumar Singh
> Attachments: RATIS-135.001.patch
>
>
> Closed segments leak memory as eviction does not remove these segments from
> closed segments list.
> {code}
> void evictCache(long[] followerIndices, long flushedIndex,
> long lastAppliedIndex) {
> List<LogSegment> toEvict = evictionPolicy.evict(followerIndices,
> flushedIndex, lastAppliedIndex, closedSegments, maxCachedSegments);
> for (LogSegment s : toEvict) {
> s.evictCache();
> }
> {code}
> After the segments have been marked for eviction, they should be removed from
> queue as well.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)