-
Bug
-
Resolution: Done
-
Major
-
9.1.3.Final, 9.2.0.Final
-
None
-
None
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
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); }