directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Seelmann <>
Subject Many threads started by Ehcache when running core-integ
Date Wed, 24 Nov 2010 07:58:30 GMT
Hi guys,

I had (and still have) problems running the core-integ tests on a
Windows 7 VM. A first analysis using jvisualvm showed that for each
test two new threads were started from Ehcache and never stopped. The
cause is that for each new DirectoryService instance a new
CacheManager is created in CacheService.

To solve that problem I tried to to call CacheManager.shutdown() in
CacheService.destroy(). However then the DNFactory didn't work any
more because it uses a static reference to the cache and that could be
a shutted down instance.

So the next step was to transform the static DNFactory. I renamed
DNFactory to DefaultDNFactory, extracted an DNFactory interface and
removed some unused methods. The DNFactory is now an instance of the
directory service and managed by the directory service. A consequence
is that some test classes can't use the DNFactory any more because it
needs to be initialized by the DirectoryService.

In the end we still create a new CacheManager (which starts its two
threads) for each test but the threads are stopped after each test.

Kind Regards,

View raw message