You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ratis.apache.org by "Mukul Kumar Singh (JIRA)" <ji...@apache.org> on 2017/11/06 04:54:00 UTC

[jira] [Created] (RATIS-135) Closed segments contribute to leaked memory as eviction policies are not honoured

Mukul Kumar Singh created RATIS-135:
---------------------------------------

             Summary: 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


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)