• Bug
  • Status: New
  • 2 Major
  • Resolution:
  • ehcache,ehcache-core
  • drb
  • Reporter: kert74
  • May 27, 2015
  • 1
  • Watchers: 2
  • May 27, 2015


In our application we create and dispose a lot of net.sf.ehcache.Cache instances (basically one create/dispose per transaction, same CacheManager) and this worked flawlessly in version 2.6.3. After upgrade to 2.10.0 the application started to throw OOMs. We tracked it down and the issue is that ExtendedStatisticsImpl registers ‘disableTask’ to executor and this task is never unregistered. Note that the disableTask occupies quite a lot of memory because it references enclosing ExtendedStatisticsImpl instance.

We think that Cache.dispose() should dispose also the StatisticsGateway, which in turn should dispose ExtendedStatistics and that should unregister the timer task.