Return-Path: Delivered-To: apmail-activemq-users-archive@www.apache.org Received: (qmail 66445 invoked from network); 15 Jan 2010 11:32:49 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 15 Jan 2010 11:32:49 -0000 Received: (qmail 39765 invoked by uid 500); 15 Jan 2010 11:32:49 -0000 Delivered-To: apmail-activemq-users-archive@activemq.apache.org Received: (qmail 39727 invoked by uid 500); 15 Jan 2010 11:32:49 -0000 Mailing-List: contact users-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@activemq.apache.org Delivered-To: mailing list users@activemq.apache.org Received: (qmail 39713 invoked by uid 99); 15 Jan 2010 11:32:49 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 15 Jan 2010 11:32:49 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of tabish121@gmail.com designates 209.85.221.195 as permitted sender) Received: from [209.85.221.195] (HELO mail-qy0-f195.google.com) (209.85.221.195) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 15 Jan 2010 11:32:39 +0000 Received: by qyk33 with SMTP id 33so399214qyk.26 for ; Fri, 15 Jan 2010 03:32:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:subject:from:to:in-reply-to :references:content-type:date:message-id:mime-version:x-mailer :content-transfer-encoding; bh=13gcCzrtCezmaIkmghQURT7BKUuGeQjt/FeAOhM77SI=; b=C0q59lZM/0S/6LHXCVfkycz2ZCqRVGVpRLopJMcSA/EX+RGz0F2yuUpaFa5aYSs+iL J9D5thUAkGJxPnORV47rWa36dFLLnmmrN0mg5Sx4GP6UTycqPHkS8xL4I8/vLbNakQ4t FPVCsWCadKiWIFZcpcUQCT2IHq9CWzn7AdrwI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=subject:from:to:in-reply-to:references:content-type:date:message-id :mime-version:x-mailer:content-transfer-encoding; b=PI7tBFub9MSHrt2iiLBJf1Vp9Y7ZfUcsM18b648lpuKGbwwZs+XoNsgjzIRRxSmZRa ANGs+lTMQ6P1zTlam6c0/DoifwTCc7vuntf/RcDZMfQHY6xjxML4TO2UGnSb458j347l hyKvhM4fTj14rrxNfuen33f6Tx2UyNZD9GYvA= Received: by 10.224.80.10 with SMTP id r10mr2087939qak.203.1263555138638; Fri, 15 Jan 2010 03:32:18 -0800 (PST) Received: from ?192.168.2.150? (c-76-21-171-30.hsd1.va.comcast.net [76.21.171.30]) by mx.google.com with ESMTPS id 23sm1583557qyk.11.2010.01.15.03.32.16 (version=SSLv3 cipher=RC4-MD5); Fri, 15 Jan 2010 03:32:17 -0800 (PST) Subject: Re: Handle leaks using CMS-3.1 From: Timothy Bish To: users@activemq.apache.org In-Reply-To: <27173352.post@talk.nabble.com> References: <27173352.post@talk.nabble.com> Content-Type: text/plain; charset="UTF-8" Date: Fri, 15 Jan 2010 06:32:15 -0500 Message-ID: <1263555135.2330.3.camel@localhost> Mime-Version: 1.0 X-Mailer: Evolution 2.28.2 (2.28.2-1.fc12) Content-Transfer-Encoding: 7bit On Fri, 2010-01-15 at 00:32 -0800, diedie wrote: > Hi, > > I recently upgraded my cms library from 3.0 to 3.1(built using vs-2005), > and face some issues that handle leaks when reconnecting to server. > > So I wrote a simple testing program based on vs2005-activemq-example, > and found that it occurs even I just create the connection and close it. > Has any one encountered this before? > Or is there anything I should notice but missed? > > Any reply is appreciated. If you could open a new Jira info and attach this info there it would help to ensure that this issue doesn't get lost on the mailing list. It looks like there could be a leak in the ConditionImpl class, which is new for this release. Regards Tim. > > > Here is the code I wrote for testing. > ============================== > while(true){ > ConnectionFactory* connectionFactory( > ConnectionFactory::createCMSConnectionFactory( "tcp://127.0.0.1:61616" ) > ); > > Connection* connection = connectionFactory->createConnection(); > connection->start(); > connection->close(); > delete connection; > connection = NULL; > delete connectionFactory; > connectionFactory = NULL; > Sleep(2000); > } > ============================= > > And following are the reports generated using DebugDiag. > It's strange that it leaks in different when I using different linking > method. > > Static Linking case : > Function msvcr80d!_beginthreadex+fd > Allocation type Thread handle(s) > Handle Count 816 handle(s) > Leak Probability 100% > > Call stack sample 1 > > Handle 0x00001448 Allocation Time 00:05:26 since tracking started > Function Source Destination > msvcr80d!_beginthreadex+fd > f:\dd\vctools\crt_bld\self_x86\crt\src\threadex.c @ 206 > kernel32!CreateThread > vs2005_activemq_example!decaf::lang::Thread::start+13b > e:\3rdparty\activemq\cms-3.1\activemq-cpp-library\src\main\decaf\lang\thread.cpp > @ 378 msvcr80d!_beginthreadex > msvcr80d!_free_dbg+5d f:\dd\vctools\crt_bld\self_x86\crt\src\dbgheap.c @ > 1222 > msvcr80d!operator delete+c6 > f:\dd\vctools\crt_bld\self_x86\crt\src\dbgdel.cpp @ 56 > vs2005_activemq_example!activemq::transport::IOTransport::start+1de > e:\3rdparty\activemq\cms-3.1\activemq-cpp-library\src\main\activemq\transport\iotransport.cpp > @ 166 > vs2005_activemq_example!activemq::transport::TransportFilter::start+53 > e:\3rdparty\activemq\cms-3.1\activemq-cpp-library\src\main\activemq\transport\transportfilter.cpp > @ 90 > vs2005_activemq_example!activemq::transport::correlator::ResponseCorrelator::start+113 > e:\3rdparty\activemq\cms-3.1\activemq-cpp-library\src\main\activemq\transport\correlator\responsecorrelator.cpp > @ 243 > vs2005_activemq_example!activemq::core::ActiveMQConnection::ActiveMQConnection+21b > e:\3rdparty\activemq\cms-3.1\activemq-cpp-library\src\main\activemq\core\activemqconnection.cpp > @ 80 > vs2005_activemq_example!activemq::core::ActiveMQConnectionFactory::createConnection+39c > e:\3rdparty\activemq\cms-3.1\activemq-cpp-library\src\main\activemq\core\activemqconnectionfactory.cpp > @ 143 > vs2005_activemq_example!main+14a > e:\3rdparty\activemq\cms-3.1\activemq-cpp-library\src\examples\main.cpp @ > 397 > vs2005_activemq_example!mainCRTStartup+d > f:\dd\vctools\crt_bld\self_x86\crt\src\crtexe.c @ 414 > kernel32!BaseProcessStart+23 > > Dynamic Linking case : > Function > libactivemq_cpp_31_vc80_mt_d!decaf::internal::util::concurrent::ConditionImpl::create+a5 > Allocation type Semaphore handle(s) > Handle Count 2730 handle(s) > Leak Probability 100% > > Call stack sample 1 > > Handle 0x00000784 > Allocation Time 00:05:06 since tracking started > Function Source Destination > libactivemq_cpp_31_vc80_mt_d!decaf::internal::util::concurrent::ConditionImpl::create+a5 > e:\3rdparty\activemq\cms-3.1\activemq-cpp-library\src\main\decaf\internal\util\concurrent\windows\conditionimpl.cpp > @ 47 kernel32!CreateSemaphoreA > libactivemq_cpp_31_vc80_mt_d!activemq::transport::tcp::TcpTransport::initialize+452 > e:\3rdparty\activemq\cms-3.1\activemq-cpp-library\src\main\activemq\transport\tcp\tcptransport.cpp > @ 129 > libactivemq_cpp_31_vc80_mt_d!activemq::transport::tcp::TcpTransportFactory::doCreateComposite+12d > e:\3rdparty\activemq\cms-3.1\activemq-cpp-library\src\main\activemq\transport\tcp\tcptransportfactory.cpp > @ 99 > libactivemq_cpp_31_vc80_mt_d!activemq::transport::tcp::TcpTransportFactory::create+c1 > e:\3rdparty\activemq\cms-3.1\activemq-cpp-library\src\main\activemq\transport\tcp\tcptransportfactory.cpp > @ 53 > libactivemq_cpp_31_vc80_mt_d!activemq::core::ActiveMQConnectionFactory::createConnection+2df > e:\3rdparty\activemq\cms-3.1\activemq-cpp-library\src\main\activemq\core\activemqconnectionfactory.cpp > @ 133 > vs2005_activemq_example!main+168 > e:\3rdparty\activemq\cms-3.1\activemq-cpp-library\src\examples\main.cpp @ > 397 > vs2005_activemq_example!mainCRTStartup+d > f:\dd\vctools\crt_bld\self_x86\crt\src\crtexe.c @ 414 > kernel32!BaseProcessStart+23 > -- Tim Bish http://fusesource.com http://timbish.blogspot.com/