Return-Path: Delivered-To: apmail-directory-dev-archive@www.apache.org Received: (qmail 99456 invoked from network); 24 Nov 2010 07:58:28 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 24 Nov 2010 07:58:28 -0000 Received: (qmail 89031 invoked by uid 500); 24 Nov 2010 07:58:59 -0000 Delivered-To: apmail-directory-dev-archive@directory.apache.org Received: (qmail 88895 invoked by uid 500); 24 Nov 2010 07:58:59 -0000 Mailing-List: contact dev-help@directory.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Apache Directory Developers List" Delivered-To: mailing list dev@directory.apache.org Received: (qmail 88888 invoked by uid 99); 24 Nov 2010 07:58:58 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 24 Nov 2010 07:58:58 +0000 X-ASF-Spam-Status: No, hits=0.7 required=10.0 tests=RCVD_IN_DNSWL_NONE,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [209.85.214.178] (HELO mail-iw0-f178.google.com) (209.85.214.178) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 24 Nov 2010 07:58:52 +0000 Received: by iwn1 with SMTP id 1so11965780iwn.37 for ; Tue, 23 Nov 2010 23:58:30 -0800 (PST) MIME-Version: 1.0 Received: by 10.231.16.75 with SMTP id n11mr9483602iba.97.1290585510667; Tue, 23 Nov 2010 23:58:30 -0800 (PST) Sender: mail@stefan-seelmann.de Received: by 10.231.19.12 with HTTP; Tue, 23 Nov 2010 23:58:30 -0800 (PST) Date: Wed, 24 Nov 2010 08:58:30 +0100 X-Google-Sender-Auth: dvDycp8TIcFbrwRyeYXhxXcFKSc Message-ID: Subject: Many threads started by Ehcache when running core-integ From: Stefan Seelmann To: Apache Directory Developers List Content-Type: text/plain; charset=UTF-8 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, Stefan