Uploaded image for project: 'Infinispan'
  1. Infinispan
  2. ISPN-8548

Clear post notifications can cause memory issues as it holds all entries locally

XMLWordPrintable

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

              wburns@redhat.com Will Burns
              wburns@redhat.com Will Burns
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: