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

contention due to the synchronized block in TimerServiceImpl.getTimers()

XMLWordPrintable

      Current TimerServiceImpl uses a HashMap to keep all timers and synchronize all read/write access to it. When there are a large number of timers, and the application keeps calling getTimers() method, the iteration over all timers can take long timer and block other threads' operations, such as creating new timer, getting individual timer, timer expiring, cancelling timer, and listing timers.

      Considering the large amount of read access, we should consider replacing the HashMap with a ConcurrentHashMap, while making sure all access to the timers cache are atomic.

              cfang@redhat.com Cheng Fang
              cfang@redhat.com Cheng Fang
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: