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

Dan Berindei (JIRA) issues at jboss.org
Wed Nov 29 04:42:03 EST 2017


     [ https://issues.jboss.org/browse/ISPN-8548?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Dan Berindei updated ISPN-8548:
-------------------------------
        Status: Resolved  (was: Pull Request Sent)
    Resolution: Done


> 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.2.0.Beta1, 9.1.3.Final
>            Reporter: William Burns
>            Assignee: William Burns
>             Fix For: 9.2.0.Beta2, 9.1.4.Final
>
>
> 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