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

Out-of-memory adding a lot of elements in cache with AsyncStore

XMLWordPrintable

      OOM occure on peaks of putting objects in cache configured to use AsyncStore.

      See Steps to Reproduce.

      Profiling shows that the gc path is through AsyncStore.state field.

      The AsyncStore.executor initialized to ThreadPoolExecutor with DiscardPolicy to silently discard tasks if the queue is full, which delays async processing of entries in state map, which continues to grow.

      Suggested solution.
      Instead of DiscardPolicy use customized behavior, which is to estimate accumulated state size and (probably comparing it with modificationQueueSize) decide to discard or to block until it is processed.

      The downside of suggested solution is the necessity to lock to estimate state size every time the task is rejected. Possibly it can be alleviated by increasing workingQueue size, so that it survive peaks without rejection.

              Unassigned Unassigned
              andpushkin Andrew Pushkin (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved:

                  Estimated:
                  Original Estimate - 3 days
                  3d
                  Remaining:
                  Remaining Estimate - 3 days
                  3d
                  Logged:
                  Time Spent - Not Specified
                  Not Specified