• Bug
  • Status: Closed
  • 0 Showstopper
  • Resolution: Fixed
  • ehcache
  • hsingh
  • Reporter: hsingh
  • November 20, 2009
  • 0
  • Watchers: 0
  • January 17, 2013
  • November 30, 2009



While running LRT for ehcache dx, there was a thread dump in the logs which contained around 584 “CounterManagerImpl Timer” threads. There are major no. of thread at stack

“CounterManagerImpl Timer” daemon prio=10 tid=0xaa015c00 nid=0x48e5 in Object.wait() [0x9cae7000] java.lang.Thread.State: WAITING (on object monitor) at java.lang.Object.wait(Native Method) - waiting on <0xb3096030> (a java.util.TaskQueue) at java.lang.Object.wait(Object.java:485) at java.util.TimerThread.mainLoop(Timer.java:483) - locked <0xb3096030> (a java.util.TaskQueue) at java.util.TimerThread.run(Timer.java:462)

and one at

“CounterManagerImpl Timer” daemon prio=10 tid=0xa686bc00 nid=0x7e5f runnable [0x9c6ca000] java.lang.Thread.State: RUNNABLE at java.util.ArrayList.(ArrayList.java:112) at java.util.ArrayList.(ArrayList.java:119) at net.sf.ehcache.Cache.getKeys(Cache.java:1231) at net.sf.ehcache.Cache.getSize(Cache.java:1727) at net.sf.ehcache.Cache.getSizeBasedOnAccuracy(Cache.java:1737) at net.sf.ehcache.Cache.getStatistics(Cache.java:2155) at org.terracotta.ehcachedx.monitor.service.cachemanager.SampledCacheStatistics$2.call(SampledCacheStatistics.java:90) at org.terracotta.ehcachedx.monitor.service.cachemanager.SampledCacheStatistics$2.call(SampledCacheStatistics.java:88) at org.terracotta.ehcachedx.monitor.counter.sampled.PullSampledCounterImpl.recordSample(PullSampledCounterImpl.java:33) - locked <0xb3688538> (a org.terracotta.ehcachedx.monitor.counter.sampled.PullSampledCounterImpl) at org.terracotta.ehcachedx.monitor.counter.sampled.SampledCounterImpl$1.run(SampledCounterImpl.java:28) at java.util.TimerThread.mainLoop(Timer.java:512) at java.util.TimerThread.run(Timer.java:462)

LRT creates a number of cache managers and shutdown them every 15 mins.

As per Alex: There should be one sampled counter thread per CacheManager but it’s entirely possible they are not getting cleaned up if the CacheManager is not being properly shut down or something. Or if there’s a bug of course.


Himadri Singh 2009-11-20

Thread dump attached.

Alex Miller 2009-11-20

Himadri, can you point at the code for this test in svn?

Alex Miller 2009-11-20

Given that this doesn’t happen w/o probe/monitor, assigning to Geert.

Himadri Singh 2009-11-20

svn url for LRT: https://svn.terracotta.org/repo/internal/qa/branches/longRunningTests-perf/

Himadri Singh 2009-12-05

Verified in rev 5534 using LRT for ehcache-dx.