[infinispan-issues] [JBoss JIRA] (ISPN-8548) Clear post notifications can cause memory issues as it holds all entries locally

William Burns (JIRA) issues at jboss.org
Tue Nov 21 08:32:00 EST 2017


William Burns created ISPN-8548:
-----------------------------------

             Summary: Clear post notifications can cause memory issues as it holds all entries locally
                 Key: ISPN-8548
                 URL: https://issues.jboss.org/browse/ISPN-8548
             Project: Infinispan
          Issue Type: Bug
    Affects Versions: 9.1.3.Final, 9.2.0.Beta1
            Reporter: William Burns
            Assignee: William Burns


Currently clear iterates over the container and stores all entries before finally invoking clear. This can cause memory issues especially for off heap as we don't want to have all of these entries in the JVM heap at the same time.

Something like

{code}
Iterator<InternalCacheEntry<Object, Object>> iterator =
dataContainer.iterator();
while (iterator.hasNext()) {
   InternalCacheEntry entry = iterator.next();
   iterator.remove();
   notifier.notifyCacheEntryRemoved(entry.getKey(), entry.getValue(),
entry.getMetadata(), false, context, command);
}
{code}



--
This message was sent by Atlassian JIRA
(v7.5.0#75005)


More information about the infinispan-issues mailing list