Uploaded image for project: 'WildFly'
  1. WildFly
  2. WFLY-2521

EJB backing cache's can generate large retention from cancelled tasks in its scheduled executor's DelayedWorkQueue

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • 8.0.0.CR1
    • 8.0.0.Beta1
    • EJB
    • None

    Description

      EJB backing cache's frequently cancel remove and passivation tasks with each access and replace them with new ones. Per http://docs.oracle.com/javase/7/docs/api/java/util/concurrent/ScheduledThreadPoolExecutor.html cancelled tasks are not removed from queue until their scheduled delay passes.

      So due to the java ScheduledThreadPoolExecutor's lazy cancelled task removal, this scheduled task cancellation and recreation model can potentially churn up quite a number of queued cancelled tasks sitting in the executor's DelayedWorkQueue. With longer timeouts and frequent ejb access, this can generate substantial heap overhead.

      It should be pretty easy to help limit any such build up by calling purge() [1] on the scheduled executor. Likely don't want to purge with each cancel, so perhaps a purge() could be called on a configurable time delay or after a configurable amount of cancels?

      [1] http://docs.oracle.com/javase/6/docs/api/java/util/concurrent/ThreadPoolExecutor.html#purge%28%29

      Attachments

        Activity

          People

            pferraro@redhat.com Paul Ferraro
            rhn-support-aogburn Aaron Ogburn
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: