Return-Path: Delivered-To: apmail-activemq-users-archive@www.apache.org Received: (qmail 5274 invoked from network); 15 Jan 2010 08:32:58 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 15 Jan 2010 08:32:58 -0000 Received: (qmail 35796 invoked by uid 500); 15 Jan 2010 08:32:57 -0000 Delivered-To: apmail-activemq-users-archive@activemq.apache.org Received: (qmail 35731 invoked by uid 500); 15 Jan 2010 08:32:57 -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 35719 invoked by uid 99); 15 Jan 2010 08:32:57 -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 08:32:57 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of lists@nabble.com designates 216.139.236.158 as permitted sender) Received: from [216.139.236.158] (HELO kuber.nabble.com) (216.139.236.158) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 15 Jan 2010 08:32:49 +0000 Received: from isper.nabble.com ([192.168.236.156]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from ) id 1NVhbY-0002Y5-Nb for users@activemq.apache.org; Fri, 15 Jan 2010 00:32:28 -0800 Message-ID: <27173352.post@talk.nabble.com> Date: Fri, 15 Jan 2010 00:32:28 -0800 (PST) From: diedie To: users@activemq.apache.org Subject: Handle leaks using CMS-3.1 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Nabble-From: yuchunchen@gvdigital.com 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. 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 -- View this message in context: http://old.nabble.com/Handle-leaks-using-CMS-3.1-tp27173352p27173352.html Sent from the ActiveMQ - User mailing list archive at Nabble.com.