Return-Path: X-Original-To: apmail-activemq-dev-archive@www.apache.org Delivered-To: apmail-activemq-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 269B9DFBC for ; Thu, 6 Sep 2012 17:29:38 +0000 (UTC) Received: (qmail 8467 invoked by uid 500); 6 Sep 2012 17:29:37 -0000 Delivered-To: apmail-activemq-dev-archive@activemq.apache.org Received: (qmail 8397 invoked by uid 500); 6 Sep 2012 17:29:37 -0000 Mailing-List: contact dev-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@activemq.apache.org Delivered-To: mailing list dev@activemq.apache.org Received: (qmail 8388 invoked by uid 99); 6 Sep 2012 17:29:37 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 06 Sep 2012 17:29:37 +0000 X-ASF-Spam-Status: No, hits=4.7 required=5.0 tests=FREEMAIL_FORGED_REPLYTO,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [98.139.91.72] (HELO nm2.bullet.mail.sp2.yahoo.com) (98.139.91.72) by apache.org (qpsmtpd/0.29) with SMTP; Thu, 06 Sep 2012 17:29:29 +0000 Received: from [98.139.91.65] by nm2.bullet.mail.sp2.yahoo.com with NNFMP; 06 Sep 2012 17:29:07 -0000 Received: from [98.139.91.5] by tm5.bullet.mail.sp2.yahoo.com with NNFMP; 06 Sep 2012 17:29:07 -0000 Received: from [127.0.0.1] by omp1005.mail.sp2.yahoo.com with NNFMP; 06 Sep 2012 17:29:07 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 575005.27156.bm@omp1005.mail.sp2.yahoo.com Received: (qmail 52271 invoked by uid 60001); 6 Sep 2012 17:29:07 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1346952546; bh=vr3m9XtT7OAPrZE53CBuqU3C8NEkbYH6DDQw+m+tg9k=; h=X-YMail-OSG:Received:X-Mailer:References:Message-ID:Date:From:Reply-To:Subject:To:In-Reply-To:MIME-Version:Content-Type; b=Xu/66jL/NT7xbDcLXdYRrg+JDA4R/GCPKu3/mfPX35/2hWTvcvDRD0ExEGmytAMKQcu2x5vPIX4VFENae9fl75avpL25CH0JRUybnRcyF0/B2JUlK6IYf80CklwlC/UoY46Bbp1qmhQvd/m1hvyiACiKakAWf5RqtXWcuK8BoEU= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:X-Mailer:References:Message-ID:Date:From:Reply-To:Subject:To:In-Reply-To:MIME-Version:Content-Type; b=3n8FjbUJQYlrEDqcTkfKZ5ue/SaEiYp/mAR6gHcQAbyCo4UFm6cQ8cAXse29T63TP4YI8VQBwHDgpvU1R1jotzLM9OhLiAoFc6bojrQUS7r8uq5Fa2K0NUMEVctCRAZ/NvS5OcLkBPIasR+vZnUFDYCj0bEdYuXS/RQZPNTZomQ=; X-YMail-OSG: 2ZTFwYoVM1mBm5Sz9YtOk9xBQc7iXanEg3BDitIbtJbOAx0 QZ94a.E8e1YEDwP5tfdxldK0Dfx4_HQaGovplEWe0cJRfeOjjnWhSk46MOnN fpLxgxDsNgKx0WWYYL0AiPiB2IJ9h3Avyd26czjc8NnPcnS9gj9u_DQBUHi7 As3GxKGQYjFzVDU8AQsuPfqxx7sGgHPn_HEqDb_RvGHbSrcoy5p66VU6Yhdu BQ9pQeEtXc1A9aQFJ7DKSbGYuEKUMeu_LjwdEYXQhpWJw2iXRvmQaFPPs4X. gWZuJu.g8FdNdubsmQKbBZ4UeEostG5J31cR9N9BnAzg95VsHrb8lon5Mpb5 dGIn8mAfH7yjtqdKGqaWPv.qFeekMWQO0vxeewUXlJVEJWVLFyu6016gbIh9 88tXkbGP9J45qUrF7qC9cpNUSqO08moGIcwW6jpdMvH.5W5XwdIAvVj6_j4j WP9YNyqInU2fCTnfLvXvdcFb5uJ_POByZA05uSW5gQY2jJEfBTNKswfBh90M eZ_gARpPAVAQMM2oKB4KjmmYFU9SnrXPsRG7v2kFowGd0dy.1ywMCHJPFuIH 4pAu2A_zucIzClam.20EUupl.0Kss.34qGBgAxM0Xmkh1Kzsp51N8Dpbkqq9 EXX_psYH.03zAdgc_9U0tX1vlrvybr034MM6qlw-- Received: from [173.48.248.209] by web39306.mail.mud.yahoo.com via HTTP; Thu, 06 Sep 2012 10:29:06 PDT X-Mailer: YahooMailWebService/0.8.121.416 References: Message-ID: <1346952546.51573.YahooMailNeo@web39306.mail.mud.yahoo.com> Date: Thu, 6 Sep 2012 10:29:06 -0700 (PDT) From: Claudio Corsi Reply-To: Claudio Corsi Subject: Re: [HEADS UP] - Graceful shutdown of AMQ and fixing some leaks when doing hot-deployment To: dev@activemq.apache.org In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="-294336953-519296709-1346952546=:51573" ---294336953-519296709-1346952546=:51573 Content-Type: text/plain; charset=us-ascii Claus, Why did you not consider using the keep alive option of the thread pool? This would reclaim threads that have been idle after a given certain time and those resources would of been reclaimed. The only consideration is that you would need to reduce the number of active threads to a small value since this is useful for created threads that exceed the minimum thread pool size. --Claudio >________________________________ > From: Claus Ibsen >To: dev@activemq.apache.org >Sent: Thursday, September 6, 2012 11:20 AM >Subject: Re: [HEADS UP] - Graceful shutdown of AMQ and fixing some leaks when doing hot-deployment > >Hi > >Okay I have been running a bunch of unit tests, and I can see that the >tests from activemq-core, is kinda dependent on the old behavior >of shutting down thread pools aggressively using shutdownNow or no >attempt to wait for in progress tasks to complete gracefully. > >So the changes being committed is currently to keep same behavior of >shutting down. Then we can gently switch over to >graceful shutdown as we fix the tests and identify the ones to switch over. > >So ThreadPoolUtils have 3 set of shutdown methods >- shutdown >- shutdownNow >- shutdownGraceful > >The first 2 is just like on the JDK executor service. >The last one is the graceful one. > > > >On Thu, Sep 6, 2012 at 2:47 PM, Claus Ibsen wrote: >> Hi >> >> Recently I have been diving into fixing some leaks in ActiveMQ. It >> started with the activemq-pool component which caused a Camel JMS >> client to become slower, due memory leaks not being released. >> >> The activemq-pool has been fixed now, and runs flawless again. >> On a side note Tim Bish is working on improving the activemq-pool to >> be a better pool by leveraging more logic from commons-pool on the >> connection side as well. Beforehand it was only the sessions that was >> leveraged. >> >> Anyway continuing with the Camel JMS client, we have reports, about >> leaks in Tomcat, when you redeploy an application. So I have been >> tracking those down, and got most of it fixed. Have some pending >> commits for the JMS client. >> >> However on embedded a full blow ActiveMQ broker in a web container as >> Tomcat, and then supporting hot deployment, surfaced some issues with >> some thread pools not being closed graceful. Instead the pools is >> closed aggresively, and as some of them have idle threads timeout of >> 30 seconds, then those threads dont timeout before the application is >> redeployed (assuming you re-deploy the app; to remedy this you would >> have to stop the app, and wait for > 30 sec, and then deploy again). >> >> As we have some good graceful shutdown code in Camel, I have ported >> part of that to AMQ, in the ThreadPoolUtils class in the util package. >> There is a number of shutdown methods, to use for graceful shutdown. >> When a graceful shutdown of a thread pool is in the works, and if it >> takes some times, then we now log every 5th second about the shutdown >> in progress. >> >> >> There is a number of tickets in JIRA about this recent work (all the >> stuff above, etc.) >> https://issues.apache.org/jira/browse/AMQ-4026 >> https://issues.apache.org/jira/browse/AMQ-4019 >> https://issues.apache.org/jira/browse/AMQ-3451 >> https://issues.apache.org/jira/browse/AMQ-4016 >> https://issues.apache.org/jira/browse/AMQ-3959 >> https://issues.apache.org/jira/browse/AMQ-3797 >> https://issues.apache.org/jira/browse/AMQ-4008 >> https://issues.apache.org/jira/browse/AMQ-4011 >> https://issues.apache.org/jira/browse/AMQ-3997 >> >> >> >> >> >> -- >> Claus Ibsen >> ----------------- >> FuseSource >> Email: cibsen@fusesource.com >> Web: http://fusesource.com >> Twitter: davsclaus, fusenews >> Blog: http://davsclaus.com >> Author of Camel in Action: http://www.manning.com/ibsen > > > >-- >Claus Ibsen >----------------- >FuseSource >Email: cibsen@fusesource.com >Web: http://fusesource.com >Twitter: davsclaus, fusenews >Blog: http://davsclaus.com >Author of Camel in Action: http://www.manning.com/ibsen > > > ---294336953-519296709-1346952546=:51573--