]
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}