You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by opernas <op...@indra.es> on 2010/02/26 10:35:20 UTC

ActiveMQ-CPP: memory leak with persistent sendings?

Hi all,


I was making test with activemq-cms and persistent messages, and  I saw that
my memory consumption was increasing for every each message that I send. The
same example with NON_PERSISTENT delivery mode flag doesn't loose any
memory. 
Valgrind with the example of your web and PERSISTENT flag on:

-----------------------------------------------------                            
Finished with the example.                                                       
=====================================================                            
==6141==                                                                         
==6141== HEAP SUMMARY:
==6141==     in use at exit: 1,750,846 bytes in 50,014 blocks
==6141==   total heap usage: 317,727 allocs, 267,713 frees, 31,314,995 bytes
allocated
==6141==
==6141== LEAK SUMMARY:
==6141==    definitely lost: 677,572 bytes in 3,999 blocks
==6141==    indirectly lost: 1,071,561 bytes in 45,977 blocks
==6141==      possibly lost: 1,685 bytes in 37 blocks
==6141==    still reachable: 28 bytes in 1 blocks
==6141==         suppressed: 0 bytes in 0 blocks
==6141== Rerun with --leak-check=full to see details of leaked memory
==6141==
==6141== For counts of detected and suppressed errors, rerun with: -v
==6141== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 37 from 6)


Perhaps it's something about the acknowledge? 



regards

-- 
View this message in context: http://old.nabble.com/ActiveMQ-CPP%3A-memory-leak-with-persistent-sendings--tp27716173p27716173.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: ActiveMQ-CPP: memory leak with persistent sendings?

Posted by Timothy Bish <ta...@gmail.com>.
On Tue, 2010-03-16 at 11:39 -0700, ironrooster wrote:
> Tim,
>   Thanks for responding so quickly!  You are correct, there is some complex
> issue that apparently has nothing to do with AMQ.  I won't belabor the point
> since the problem is now solved - or at least underground - but FYI we are
> using AMQ in a DLL called from LabVIEW.  I think that there was a problem
> with the LabVIEW system.  Thanks again for your quick response.
> 
> 

Great, always glad to hear that I don't need to do anything.  Thanks for
letting us know.  

Regards
Tim.

> 
> Timothy Bish wrote:
> > 
> > On Thu, 2010-03-11 at 18:44 -0800, ironrooster wrote:
> >> Hi,
> >>    I'm having a similar issue: using activeme-cpp 3.1.1, there is a large
> >> memory leak when sending text messages.  Here's a code snippet:
> >> 
> >> 
> >> 
> >> Here's the setup in my run method:
> >> {
> >>         // Create a ConnectionFactory
> >>         auto_ptr<ConnectionFactory> connectionFactory(
> >>             ConnectionFactory::createCMSConnectionFactory( brokerURI ) );
> >> 
> >>         // Create a Connection
> >>         connection = connectionFactory->createConnection();
> >>         connection->start();
> >> 
> >>         // Create a Session
> >>         session = connection->createSession( Session::AUTO_ACKNOWLEDGE );
> >> 
> >>         // Create the destination 
> >>         destination = session->createTopic( topicName );
> >> 
> >>         // Create a MessageProducer from the Session to the Topic or
> >> Queue
> >>         producer = session->createProducer( destination );
> >>         producer->setDeliveryMode( DeliveryMode::NON_PERSISTENT );
> >> 
> >> 		// Wait until the caller tells us we're done.
> >> 		doneLatch.await();
> >> }
> >> 
> >> 
> >> 
> >> void Producer::sendMessage( const std::string& messageArg)
> >> {
> >>         TextMessage* message = session->createTextMessage( messageArg );
> >> 	producer->setTimeToLive( 10000 );
> >>         producer->send( message );
> >>         delete message;
> >> } // End of sendMessage()
> >> 
> >> 
> >> If I comment out the producer->send() line, no leak. Any help would be
> >> appreciated!  Thanks.
> >> 
> >> 
> > 
> > If you can provide a *complete* example of your code that demonstrates
> > the issue I'd be glad to look into it.  The current samples and test
> > have all been run through valgrind with no leaks reported so there must
> > be something unique to your test case that's not been tested yet.
> > 
> > Regards
> > Tim.
> > 
> > 
> >> 
> >> Timothy Bish wrote:
> >> > 
> >> > On Fri, 2010-02-26 at 07:14 -0800, opernas wrote:
> >> >> Version is 3.1.0
> >> >> 
> >> > Please give 3.1.1 a try as there were several fixes in that release for
> >> > memory leaks.
> >> > 
> >> > Regards
> >> > 
> >> > 
> >> >> 
> >> >> Timothy Bish wrote:
> >> >> > 
> >> >> > On Fri, 2010-02-26 at 03:45 -0800, opernas wrote:
> >> >> >> 
> >> >> >> Like I said, this issue occurred with my app but in
> >> SimpleProducer.cpp
> >> >> >> sample too. If you take SimpleProducer.cpp and put DeliverMode flag
> >> to
> >> >> >> PERSISTENT (instead of NON_PERSISTENT).
> >> >> >> 
> >> >> >> ==3085== 160 bytes in 20 blocks are definitely lost in loss record
> >> 27
> >> >> of
> >> >> >> 40                                                                                                                                    
> >> >> >> ==3085==    at 0x40253C5: operator new(unsigned int)
> >> >> >> (vg_replace_malloc.c:214)                                                                                                                                 
> >> >> >> ==3085==    by 0x4313A16:
> >> >> >> activemq::core::ActiveMQSession::send(cms::Message*,
> >> >> >> activemq::core::ActiveMQProducer*, activemq::util::Usage*)
> >> >> (Pointer.h:45)                                                       
> >> >> >> ==3085==    by 0x430843E:
> >> >> >> activemq::core::ActiveMQProducer::send(cms::Destination const*,
> >> >> >> cms::Message*, int, int, long long) (ActiveMQProducer.cpp:197)                                                       
> >> >> >> ==3085==    by 0x43065F6:
> >> >> >> activemq::core::ActiveMQProducer::send(cms::Destination const*,
> >> >> >> cms::Message*) (ActiveMQProducer.cpp:134)                                                                            
> >> >> >> ==3085==    by 0x43074FA:
> >> >> >> activemq::core::ActiveMQProducer::send(cms::Message*)
> >> >> >> (ActiveMQProducer.cpp:102)                                                                                                     
> >> >> >> ==3085==    by 0x8049F4D: SimpleProducer::run() (prueba.cpp:126)                                                                                                                                               
> >> >> >> ==3085==    by 0x804928A: main (prueba.cpp:227)
> >> >> >> 
> >> >> >> 
> >> >> >> ==3085== LEAK SUMMARY:
> >> >> >> ==3085==    definitely lost: 7,280 bytes in 40 blocks
> >> >> >> ==3085==    indirectly lost: 10,406 bytes in 468 blocks
> >> >> >> ==3085==      possibly lost: 784 bytes in 6 blocks
> >> >> >> ==3085==    still reachable: 28 bytes in 1 blocks
> >> >> >> ==3085==         suppressed: 0 bytes in 0 blocks
> >> >> >> 
> >> >> >> Is in the producer->send() call... but I dont know if I've some
> >> >> mistake,
> >> >> >> or
> >> >> >> if a put PERSISTENT, i need to do something else... i've tried
> >> >> different
> >> >> >> ackwnoledge methods, but i've still loosing memory.
> >> >> >> 
> >> >> >> 
> >> >> > 
> >> >> > It would help to know the version of the client you are using.  The
> >> >> most
> >> >> > recent 3.1.1 release has several memory and resource leak fixes in
> >> it.
> >> >> > 
> >> >> > Regards
> >> >> > 
> >> >> > 
> >> >> > -- 
> >> >> > Tim Bish
> >> >> > 
> >> >> > Open Source Integration: http://fusesource.com
> >> >> > ActiveMQ in Action: http://www.manning.com/snyder/
> >> >> > 
> >> >> > Follow me on Twitter: http://twitter.com/tabish121
> >> >> > My Blog: http://timbish.blogspot.com/
> >> >> > 
> >> >> > 
> >> >> > 
> >> >> 
> >> > 
> >> > -- 
> >> > Tim Bish
> >> > 
> >> > Open Source Integration: http://fusesource.com
> >> > ActiveMQ in Action: http://www.manning.com/snyder/
> >> > 
> >> > Follow me on Twitter: http://twitter.com/tabish121
> >> > My Blog: http://timbish.blogspot.com/
> >> > 
> >> > 
> >> > 
> >> 
> > 
> > -- 
> > Tim Bish
> > 
> > Open Source Integration: http://fusesource.com
> > ActiveMQ in Action: http://www.manning.com/snyder/
> > 
> > Follow me on Twitter: http://twitter.com/tabish121
> > My Blog: http://timbish.blogspot.com/
> > 
> > 
> > 
> 

-- 
Tim Bish

Open Source Integration: http://fusesource.com
ActiveMQ in Action: http://www.manning.com/snyder/

Follow me on Twitter: http://twitter.com/tabish121
My Blog: http://timbish.blogspot.com/


Re: ActiveMQ-CPP: memory leak with persistent sendings?

Posted by ironrooster <gr...@lowell.edu>.
Tim,
  Thanks for responding so quickly!  You are correct, there is some complex
issue that apparently has nothing to do with AMQ.  I won't belabor the point
since the problem is now solved - or at least underground - but FYI we are
using AMQ in a DLL called from LabVIEW.  I think that there was a problem
with the LabVIEW system.  Thanks again for your quick response.



Timothy Bish wrote:
> 
> On Thu, 2010-03-11 at 18:44 -0800, ironrooster wrote:
>> Hi,
>>    I'm having a similar issue: using activeme-cpp 3.1.1, there is a large
>> memory leak when sending text messages.  Here's a code snippet:
>> 
>> 
>> 
>> Here's the setup in my run method:
>> {
>>         // Create a ConnectionFactory
>>         auto_ptr<ConnectionFactory> connectionFactory(
>>             ConnectionFactory::createCMSConnectionFactory( brokerURI ) );
>> 
>>         // Create a Connection
>>         connection = connectionFactory->createConnection();
>>         connection->start();
>> 
>>         // Create a Session
>>         session = connection->createSession( Session::AUTO_ACKNOWLEDGE );
>> 
>>         // Create the destination 
>>         destination = session->createTopic( topicName );
>> 
>>         // Create a MessageProducer from the Session to the Topic or
>> Queue
>>         producer = session->createProducer( destination );
>>         producer->setDeliveryMode( DeliveryMode::NON_PERSISTENT );
>> 
>> 		// Wait until the caller tells us we're done.
>> 		doneLatch.await();
>> }
>> 
>> 
>> 
>> void Producer::sendMessage( const std::string& messageArg)
>> {
>>         TextMessage* message = session->createTextMessage( messageArg );
>> 	producer->setTimeToLive( 10000 );
>>         producer->send( message );
>>         delete message;
>> } // End of sendMessage()
>> 
>> 
>> If I comment out the producer->send() line, no leak. Any help would be
>> appreciated!  Thanks.
>> 
>> 
> 
> If you can provide a *complete* example of your code that demonstrates
> the issue I'd be glad to look into it.  The current samples and test
> have all been run through valgrind with no leaks reported so there must
> be something unique to your test case that's not been tested yet.
> 
> Regards
> Tim.
> 
> 
>> 
>> Timothy Bish wrote:
>> > 
>> > On Fri, 2010-02-26 at 07:14 -0800, opernas wrote:
>> >> Version is 3.1.0
>> >> 
>> > Please give 3.1.1 a try as there were several fixes in that release for
>> > memory leaks.
>> > 
>> > Regards
>> > 
>> > 
>> >> 
>> >> Timothy Bish wrote:
>> >> > 
>> >> > On Fri, 2010-02-26 at 03:45 -0800, opernas wrote:
>> >> >> 
>> >> >> Like I said, this issue occurred with my app but in
>> SimpleProducer.cpp
>> >> >> sample too. If you take SimpleProducer.cpp and put DeliverMode flag
>> to
>> >> >> PERSISTENT (instead of NON_PERSISTENT).
>> >> >> 
>> >> >> ==3085== 160 bytes in 20 blocks are definitely lost in loss record
>> 27
>> >> of
>> >> >> 40                                                                                                                                    
>> >> >> ==3085==    at 0x40253C5: operator new(unsigned int)
>> >> >> (vg_replace_malloc.c:214)                                                                                                                                 
>> >> >> ==3085==    by 0x4313A16:
>> >> >> activemq::core::ActiveMQSession::send(cms::Message*,
>> >> >> activemq::core::ActiveMQProducer*, activemq::util::Usage*)
>> >> (Pointer.h:45)                                                       
>> >> >> ==3085==    by 0x430843E:
>> >> >> activemq::core::ActiveMQProducer::send(cms::Destination const*,
>> >> >> cms::Message*, int, int, long long) (ActiveMQProducer.cpp:197)                                                       
>> >> >> ==3085==    by 0x43065F6:
>> >> >> activemq::core::ActiveMQProducer::send(cms::Destination const*,
>> >> >> cms::Message*) (ActiveMQProducer.cpp:134)                                                                            
>> >> >> ==3085==    by 0x43074FA:
>> >> >> activemq::core::ActiveMQProducer::send(cms::Message*)
>> >> >> (ActiveMQProducer.cpp:102)                                                                                                     
>> >> >> ==3085==    by 0x8049F4D: SimpleProducer::run() (prueba.cpp:126)                                                                                                                                               
>> >> >> ==3085==    by 0x804928A: main (prueba.cpp:227)
>> >> >> 
>> >> >> 
>> >> >> ==3085== LEAK SUMMARY:
>> >> >> ==3085==    definitely lost: 7,280 bytes in 40 blocks
>> >> >> ==3085==    indirectly lost: 10,406 bytes in 468 blocks
>> >> >> ==3085==      possibly lost: 784 bytes in 6 blocks
>> >> >> ==3085==    still reachable: 28 bytes in 1 blocks
>> >> >> ==3085==         suppressed: 0 bytes in 0 blocks
>> >> >> 
>> >> >> Is in the producer->send() call... but I dont know if I've some
>> >> mistake,
>> >> >> or
>> >> >> if a put PERSISTENT, i need to do something else... i've tried
>> >> different
>> >> >> ackwnoledge methods, but i've still loosing memory.
>> >> >> 
>> >> >> 
>> >> > 
>> >> > It would help to know the version of the client you are using.  The
>> >> most
>> >> > recent 3.1.1 release has several memory and resource leak fixes in
>> it.
>> >> > 
>> >> > Regards
>> >> > 
>> >> > 
>> >> > -- 
>> >> > Tim Bish
>> >> > 
>> >> > Open Source Integration: http://fusesource.com
>> >> > ActiveMQ in Action: http://www.manning.com/snyder/
>> >> > 
>> >> > Follow me on Twitter: http://twitter.com/tabish121
>> >> > My Blog: http://timbish.blogspot.com/
>> >> > 
>> >> > 
>> >> > 
>> >> 
>> > 
>> > -- 
>> > Tim Bish
>> > 
>> > Open Source Integration: http://fusesource.com
>> > ActiveMQ in Action: http://www.manning.com/snyder/
>> > 
>> > Follow me on Twitter: http://twitter.com/tabish121
>> > My Blog: http://timbish.blogspot.com/
>> > 
>> > 
>> > 
>> 
> 
> -- 
> Tim Bish
> 
> Open Source Integration: http://fusesource.com
> ActiveMQ in Action: http://www.manning.com/snyder/
> 
> Follow me on Twitter: http://twitter.com/tabish121
> My Blog: http://timbish.blogspot.com/
> 
> 
> 

-- 
View this message in context: http://old.nabble.com/ActiveMQ-CPP%3A-memory-leak-with-persistent-sendings--tp27716173p27922715.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: ActiveMQ-CPP: memory leak with persistent sendings?

Posted by Timothy Bish <ta...@gmail.com>.
On Thu, 2010-03-11 at 18:44 -0800, ironrooster wrote:
> Hi,
>    I'm having a similar issue: using activeme-cpp 3.1.1, there is a large
> memory leak when sending text messages.  Here's a code snippet:
> 
> 
> 
> Here's the setup in my run method:
> {
>         // Create a ConnectionFactory
>         auto_ptr<ConnectionFactory> connectionFactory(
>             ConnectionFactory::createCMSConnectionFactory( brokerURI ) );
> 
>         // Create a Connection
>         connection = connectionFactory->createConnection();
>         connection->start();
> 
>         // Create a Session
>         session = connection->createSession( Session::AUTO_ACKNOWLEDGE );
> 
>         // Create the destination 
>         destination = session->createTopic( topicName );
> 
>         // Create a MessageProducer from the Session to the Topic or Queue
>         producer = session->createProducer( destination );
>         producer->setDeliveryMode( DeliveryMode::NON_PERSISTENT );
> 
> 		// Wait until the caller tells us we're done.
> 		doneLatch.await();
> }
> 
> 
> 
> void Producer::sendMessage( const std::string& messageArg)
> {
>         TextMessage* message = session->createTextMessage( messageArg );
> 	producer->setTimeToLive( 10000 );
>         producer->send( message );
>         delete message;
> } // End of sendMessage()
> 
> 
> If I comment out the producer->send() line, no leak. Any help would be
> appreciated!  Thanks.
> 
> 

If you can provide a *complete* example of your code that demonstrates
the issue I'd be glad to look into it.  The current samples and test
have all been run through valgrind with no leaks reported so there must
be something unique to your test case that's not been tested yet.

Regards
Tim.


> 
> Timothy Bish wrote:
> > 
> > On Fri, 2010-02-26 at 07:14 -0800, opernas wrote:
> >> Version is 3.1.0
> >> 
> > Please give 3.1.1 a try as there were several fixes in that release for
> > memory leaks.
> > 
> > Regards
> > 
> > 
> >> 
> >> Timothy Bish wrote:
> >> > 
> >> > On Fri, 2010-02-26 at 03:45 -0800, opernas wrote:
> >> >> 
> >> >> Like I said, this issue occurred with my app but in SimpleProducer.cpp
> >> >> sample too. If you take SimpleProducer.cpp and put DeliverMode flag to
> >> >> PERSISTENT (instead of NON_PERSISTENT).
> >> >> 
> >> >> ==3085== 160 bytes in 20 blocks are definitely lost in loss record 27
> >> of
> >> >> 40                                                                                                                                    
> >> >> ==3085==    at 0x40253C5: operator new(unsigned int)
> >> >> (vg_replace_malloc.c:214)                                                                                                                                 
> >> >> ==3085==    by 0x4313A16:
> >> >> activemq::core::ActiveMQSession::send(cms::Message*,
> >> >> activemq::core::ActiveMQProducer*, activemq::util::Usage*)
> >> (Pointer.h:45)                                                       
> >> >> ==3085==    by 0x430843E:
> >> >> activemq::core::ActiveMQProducer::send(cms::Destination const*,
> >> >> cms::Message*, int, int, long long) (ActiveMQProducer.cpp:197)                                                       
> >> >> ==3085==    by 0x43065F6:
> >> >> activemq::core::ActiveMQProducer::send(cms::Destination const*,
> >> >> cms::Message*) (ActiveMQProducer.cpp:134)                                                                            
> >> >> ==3085==    by 0x43074FA:
> >> >> activemq::core::ActiveMQProducer::send(cms::Message*)
> >> >> (ActiveMQProducer.cpp:102)                                                                                                     
> >> >> ==3085==    by 0x8049F4D: SimpleProducer::run() (prueba.cpp:126)                                                                                                                                               
> >> >> ==3085==    by 0x804928A: main (prueba.cpp:227)
> >> >> 
> >> >> 
> >> >> ==3085== LEAK SUMMARY:
> >> >> ==3085==    definitely lost: 7,280 bytes in 40 blocks
> >> >> ==3085==    indirectly lost: 10,406 bytes in 468 blocks
> >> >> ==3085==      possibly lost: 784 bytes in 6 blocks
> >> >> ==3085==    still reachable: 28 bytes in 1 blocks
> >> >> ==3085==         suppressed: 0 bytes in 0 blocks
> >> >> 
> >> >> Is in the producer->send() call... but I dont know if I've some
> >> mistake,
> >> >> or
> >> >> if a put PERSISTENT, i need to do something else... i've tried
> >> different
> >> >> ackwnoledge methods, but i've still loosing memory.
> >> >> 
> >> >> 
> >> > 
> >> > It would help to know the version of the client you are using.  The
> >> most
> >> > recent 3.1.1 release has several memory and resource leak fixes in it.
> >> > 
> >> > Regards
> >> > 
> >> > 
> >> > -- 
> >> > Tim Bish
> >> > 
> >> > Open Source Integration: http://fusesource.com
> >> > ActiveMQ in Action: http://www.manning.com/snyder/
> >> > 
> >> > Follow me on Twitter: http://twitter.com/tabish121
> >> > My Blog: http://timbish.blogspot.com/
> >> > 
> >> > 
> >> > 
> >> 
> > 
> > -- 
> > Tim Bish
> > 
> > Open Source Integration: http://fusesource.com
> > ActiveMQ in Action: http://www.manning.com/snyder/
> > 
> > Follow me on Twitter: http://twitter.com/tabish121
> > My Blog: http://timbish.blogspot.com/
> > 
> > 
> > 
> 

-- 
Tim Bish

Open Source Integration: http://fusesource.com
ActiveMQ in Action: http://www.manning.com/snyder/

Follow me on Twitter: http://twitter.com/tabish121
My Blog: http://timbish.blogspot.com/


Re: ActiveMQ-CPP: memory leak with persistent sendings?

Posted by ironrooster <gr...@lowell.edu>.
Hi,
   I'm having a similar issue: using activeme-cpp 3.1.1, there is a large
memory leak when sending text messages.  Here's a code snippet:



Here's the setup in my run method:
{
        // Create a ConnectionFactory
        auto_ptr<ConnectionFactory> connectionFactory(
            ConnectionFactory::createCMSConnectionFactory( brokerURI ) );

        // Create a Connection
        connection = connectionFactory->createConnection();
        connection->start();

        // Create a Session
        session = connection->createSession( Session::AUTO_ACKNOWLEDGE );

        // Create the destination 
        destination = session->createTopic( topicName );

        // Create a MessageProducer from the Session to the Topic or Queue
        producer = session->createProducer( destination );
        producer->setDeliveryMode( DeliveryMode::NON_PERSISTENT );

		// Wait until the caller tells us we're done.
		doneLatch.await();
}



void Producer::sendMessage( const std::string& messageArg)
{
        TextMessage* message = session->createTextMessage( messageArg );
	producer->setTimeToLive( 10000 );
        producer->send( message );
        delete message;
} // End of sendMessage()


If I comment out the producer->send() line, no leak. Any help would be
appreciated!  Thanks.



Timothy Bish wrote:
> 
> On Fri, 2010-02-26 at 07:14 -0800, opernas wrote:
>> Version is 3.1.0
>> 
> Please give 3.1.1 a try as there were several fixes in that release for
> memory leaks.
> 
> Regards
> 
> 
>> 
>> Timothy Bish wrote:
>> > 
>> > On Fri, 2010-02-26 at 03:45 -0800, opernas wrote:
>> >> 
>> >> Like I said, this issue occurred with my app but in SimpleProducer.cpp
>> >> sample too. If you take SimpleProducer.cpp and put DeliverMode flag to
>> >> PERSISTENT (instead of NON_PERSISTENT).
>> >> 
>> >> ==3085== 160 bytes in 20 blocks are definitely lost in loss record 27
>> of
>> >> 40                                                                                                                                    
>> >> ==3085==    at 0x40253C5: operator new(unsigned int)
>> >> (vg_replace_malloc.c:214)                                                                                                                                 
>> >> ==3085==    by 0x4313A16:
>> >> activemq::core::ActiveMQSession::send(cms::Message*,
>> >> activemq::core::ActiveMQProducer*, activemq::util::Usage*)
>> (Pointer.h:45)                                                       
>> >> ==3085==    by 0x430843E:
>> >> activemq::core::ActiveMQProducer::send(cms::Destination const*,
>> >> cms::Message*, int, int, long long) (ActiveMQProducer.cpp:197)                                                       
>> >> ==3085==    by 0x43065F6:
>> >> activemq::core::ActiveMQProducer::send(cms::Destination const*,
>> >> cms::Message*) (ActiveMQProducer.cpp:134)                                                                            
>> >> ==3085==    by 0x43074FA:
>> >> activemq::core::ActiveMQProducer::send(cms::Message*)
>> >> (ActiveMQProducer.cpp:102)                                                                                                     
>> >> ==3085==    by 0x8049F4D: SimpleProducer::run() (prueba.cpp:126)                                                                                                                                               
>> >> ==3085==    by 0x804928A: main (prueba.cpp:227)
>> >> 
>> >> 
>> >> ==3085== LEAK SUMMARY:
>> >> ==3085==    definitely lost: 7,280 bytes in 40 blocks
>> >> ==3085==    indirectly lost: 10,406 bytes in 468 blocks
>> >> ==3085==      possibly lost: 784 bytes in 6 blocks
>> >> ==3085==    still reachable: 28 bytes in 1 blocks
>> >> ==3085==         suppressed: 0 bytes in 0 blocks
>> >> 
>> >> Is in the producer->send() call... but I dont know if I've some
>> mistake,
>> >> or
>> >> if a put PERSISTENT, i need to do something else... i've tried
>> different
>> >> ackwnoledge methods, but i've still loosing memory.
>> >> 
>> >> 
>> > 
>> > It would help to know the version of the client you are using.  The
>> most
>> > recent 3.1.1 release has several memory and resource leak fixes in it.
>> > 
>> > Regards
>> > 
>> > 
>> > -- 
>> > Tim Bish
>> > 
>> > Open Source Integration: http://fusesource.com
>> > ActiveMQ in Action: http://www.manning.com/snyder/
>> > 
>> > Follow me on Twitter: http://twitter.com/tabish121
>> > My Blog: http://timbish.blogspot.com/
>> > 
>> > 
>> > 
>> 
> 
> -- 
> Tim Bish
> 
> Open Source Integration: http://fusesource.com
> ActiveMQ in Action: http://www.manning.com/snyder/
> 
> Follow me on Twitter: http://twitter.com/tabish121
> My Blog: http://timbish.blogspot.com/
> 
> 
> 

-- 
View this message in context: http://old.nabble.com/ActiveMQ-CPP%3A-memory-leak-with-persistent-sendings--tp27716173p27872774.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: ActiveMQ-CPP: memory leak with persistent sendings?

Posted by Timothy Bish <ta...@gmail.com>.
On Fri, 2010-02-26 at 07:14 -0800, opernas wrote:
> Version is 3.1.0
> 
Please give 3.1.1 a try as there were several fixes in that release for
memory leaks.

Regards


> 
> Timothy Bish wrote:
> > 
> > On Fri, 2010-02-26 at 03:45 -0800, opernas wrote:
> >> 
> >> Like I said, this issue occurred with my app but in SimpleProducer.cpp
> >> sample too. If you take SimpleProducer.cpp and put DeliverMode flag to
> >> PERSISTENT (instead of NON_PERSISTENT).
> >> 
> >> ==3085== 160 bytes in 20 blocks are definitely lost in loss record 27 of
> >> 40                                                                                                                                    
> >> ==3085==    at 0x40253C5: operator new(unsigned int)
> >> (vg_replace_malloc.c:214)                                                                                                                                 
> >> ==3085==    by 0x4313A16:
> >> activemq::core::ActiveMQSession::send(cms::Message*,
> >> activemq::core::ActiveMQProducer*, activemq::util::Usage*) (Pointer.h:45)                                                       
> >> ==3085==    by 0x430843E:
> >> activemq::core::ActiveMQProducer::send(cms::Destination const*,
> >> cms::Message*, int, int, long long) (ActiveMQProducer.cpp:197)                                                       
> >> ==3085==    by 0x43065F6:
> >> activemq::core::ActiveMQProducer::send(cms::Destination const*,
> >> cms::Message*) (ActiveMQProducer.cpp:134)                                                                            
> >> ==3085==    by 0x43074FA:
> >> activemq::core::ActiveMQProducer::send(cms::Message*)
> >> (ActiveMQProducer.cpp:102)                                                                                                     
> >> ==3085==    by 0x8049F4D: SimpleProducer::run() (prueba.cpp:126)                                                                                                                                               
> >> ==3085==    by 0x804928A: main (prueba.cpp:227)
> >> 
> >> 
> >> ==3085== LEAK SUMMARY:
> >> ==3085==    definitely lost: 7,280 bytes in 40 blocks
> >> ==3085==    indirectly lost: 10,406 bytes in 468 blocks
> >> ==3085==      possibly lost: 784 bytes in 6 blocks
> >> ==3085==    still reachable: 28 bytes in 1 blocks
> >> ==3085==         suppressed: 0 bytes in 0 blocks
> >> 
> >> Is in the producer->send() call... but I dont know if I've some mistake,
> >> or
> >> if a put PERSISTENT, i need to do something else... i've tried different
> >> ackwnoledge methods, but i've still loosing memory.
> >> 
> >> 
> > 
> > It would help to know the version of the client you are using.  The most
> > recent 3.1.1 release has several memory and resource leak fixes in it.
> > 
> > Regards
> > 
> > 
> > -- 
> > Tim Bish
> > 
> > Open Source Integration: http://fusesource.com
> > ActiveMQ in Action: http://www.manning.com/snyder/
> > 
> > Follow me on Twitter: http://twitter.com/tabish121
> > My Blog: http://timbish.blogspot.com/
> > 
> > 
> > 
> 

-- 
Tim Bish

Open Source Integration: http://fusesource.com
ActiveMQ in Action: http://www.manning.com/snyder/

Follow me on Twitter: http://twitter.com/tabish121
My Blog: http://timbish.blogspot.com/


Re: ActiveMQ-CPP: memory leak with persistent sendings?

Posted by opernas <op...@indra.es>.
Version is 3.1.0


Timothy Bish wrote:
> 
> On Fri, 2010-02-26 at 03:45 -0800, opernas wrote:
>> 
>> Like I said, this issue occurred with my app but in SimpleProducer.cpp
>> sample too. If you take SimpleProducer.cpp and put DeliverMode flag to
>> PERSISTENT (instead of NON_PERSISTENT).
>> 
>> ==3085== 160 bytes in 20 blocks are definitely lost in loss record 27 of
>> 40                                                                                                                                    
>> ==3085==    at 0x40253C5: operator new(unsigned int)
>> (vg_replace_malloc.c:214)                                                                                                                                 
>> ==3085==    by 0x4313A16:
>> activemq::core::ActiveMQSession::send(cms::Message*,
>> activemq::core::ActiveMQProducer*, activemq::util::Usage*) (Pointer.h:45)                                                       
>> ==3085==    by 0x430843E:
>> activemq::core::ActiveMQProducer::send(cms::Destination const*,
>> cms::Message*, int, int, long long) (ActiveMQProducer.cpp:197)                                                       
>> ==3085==    by 0x43065F6:
>> activemq::core::ActiveMQProducer::send(cms::Destination const*,
>> cms::Message*) (ActiveMQProducer.cpp:134)                                                                            
>> ==3085==    by 0x43074FA:
>> activemq::core::ActiveMQProducer::send(cms::Message*)
>> (ActiveMQProducer.cpp:102)                                                                                                     
>> ==3085==    by 0x8049F4D: SimpleProducer::run() (prueba.cpp:126)                                                                                                                                               
>> ==3085==    by 0x804928A: main (prueba.cpp:227)
>> 
>> 
>> ==3085== LEAK SUMMARY:
>> ==3085==    definitely lost: 7,280 bytes in 40 blocks
>> ==3085==    indirectly lost: 10,406 bytes in 468 blocks
>> ==3085==      possibly lost: 784 bytes in 6 blocks
>> ==3085==    still reachable: 28 bytes in 1 blocks
>> ==3085==         suppressed: 0 bytes in 0 blocks
>> 
>> Is in the producer->send() call... but I dont know if I've some mistake,
>> or
>> if a put PERSISTENT, i need to do something else... i've tried different
>> ackwnoledge methods, but i've still loosing memory.
>> 
>> 
> 
> It would help to know the version of the client you are using.  The most
> recent 3.1.1 release has several memory and resource leak fixes in it.
> 
> Regards
> 
> 
> -- 
> Tim Bish
> 
> Open Source Integration: http://fusesource.com
> ActiveMQ in Action: http://www.manning.com/snyder/
> 
> Follow me on Twitter: http://twitter.com/tabish121
> My Blog: http://timbish.blogspot.com/
> 
> 
> 

-- 
View this message in context: http://old.nabble.com/ActiveMQ-CPP%3A-memory-leak-with-persistent-sendings--tp27716173p27719456.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: ActiveMQ-CPP: memory leak with persistent sendings?

Posted by Timothy Bish <ta...@gmail.com>.
On Fri, 2010-02-26 at 03:45 -0800, opernas wrote:
> 
> Like I said, this issue occurred with my app but in SimpleProducer.cpp
> sample too. If you take SimpleProducer.cpp and put DeliverMode flag to
> PERSISTENT (instead of NON_PERSISTENT).
> 
> ==3085== 160 bytes in 20 blocks are definitely lost in loss record 27 of 40                                                                                                                                    
> ==3085==    at 0x40253C5: operator new(unsigned int)
> (vg_replace_malloc.c:214)                                                                                                                                 
> ==3085==    by 0x4313A16:
> activemq::core::ActiveMQSession::send(cms::Message*,
> activemq::core::ActiveMQProducer*, activemq::util::Usage*) (Pointer.h:45)                                                       
> ==3085==    by 0x430843E:
> activemq::core::ActiveMQProducer::send(cms::Destination const*,
> cms::Message*, int, int, long long) (ActiveMQProducer.cpp:197)                                                       
> ==3085==    by 0x43065F6:
> activemq::core::ActiveMQProducer::send(cms::Destination const*,
> cms::Message*) (ActiveMQProducer.cpp:134)                                                                            
> ==3085==    by 0x43074FA:
> activemq::core::ActiveMQProducer::send(cms::Message*)
> (ActiveMQProducer.cpp:102)                                                                                                     
> ==3085==    by 0x8049F4D: SimpleProducer::run() (prueba.cpp:126)                                                                                                                                               
> ==3085==    by 0x804928A: main (prueba.cpp:227)
> 
> 
> ==3085== LEAK SUMMARY:
> ==3085==    definitely lost: 7,280 bytes in 40 blocks
> ==3085==    indirectly lost: 10,406 bytes in 468 blocks
> ==3085==      possibly lost: 784 bytes in 6 blocks
> ==3085==    still reachable: 28 bytes in 1 blocks
> ==3085==         suppressed: 0 bytes in 0 blocks
> 
> Is in the producer->send() call... but I dont know if I've some mistake, or
> if a put PERSISTENT, i need to do something else... i've tried different
> ackwnoledge methods, but i've still loosing memory.
> 
> 

It would help to know the version of the client you are using.  The most
recent 3.1.1 release has several memory and resource leak fixes in it.

Regards


-- 
Tim Bish

Open Source Integration: http://fusesource.com
ActiveMQ in Action: http://www.manning.com/snyder/

Follow me on Twitter: http://twitter.com/tabish121
My Blog: http://timbish.blogspot.com/


Re: ActiveMQ-CPP: memory leak with persistent sendings?

Posted by opernas <op...@indra.es>.

Like I said, this issue occurred with my app but in SimpleProducer.cpp
sample too. If you take SimpleProducer.cpp and put DeliverMode flag to
PERSISTENT (instead of NON_PERSISTENT).

==3085== 160 bytes in 20 blocks are definitely lost in loss record 27 of 40                                                                                                                                    
==3085==    at 0x40253C5: operator new(unsigned int)
(vg_replace_malloc.c:214)                                                                                                                                 
==3085==    by 0x4313A16:
activemq::core::ActiveMQSession::send(cms::Message*,
activemq::core::ActiveMQProducer*, activemq::util::Usage*) (Pointer.h:45)                                                       
==3085==    by 0x430843E:
activemq::core::ActiveMQProducer::send(cms::Destination const*,
cms::Message*, int, int, long long) (ActiveMQProducer.cpp:197)                                                       
==3085==    by 0x43065F6:
activemq::core::ActiveMQProducer::send(cms::Destination const*,
cms::Message*) (ActiveMQProducer.cpp:134)                                                                            
==3085==    by 0x43074FA:
activemq::core::ActiveMQProducer::send(cms::Message*)
(ActiveMQProducer.cpp:102)                                                                                                     
==3085==    by 0x8049F4D: SimpleProducer::run() (prueba.cpp:126)                                                                                                                                               
==3085==    by 0x804928A: main (prueba.cpp:227)


==3085== LEAK SUMMARY:
==3085==    definitely lost: 7,280 bytes in 40 blocks
==3085==    indirectly lost: 10,406 bytes in 468 blocks
==3085==      possibly lost: 784 bytes in 6 blocks
==3085==    still reachable: 28 bytes in 1 blocks
==3085==         suppressed: 0 bytes in 0 blocks

Is in the producer->send() call... but I dont know if I've some mistake, or
if a put PERSISTENT, i need to do something else... i've tried different
ackwnoledge methods, but i've still loosing memory.





Timothy Bish wrote:
> 
> On Fri, 2010-02-26 at 01:35 -0800, opernas wrote:
>> Hi all,
>> 
>> 
>> I was making test with activemq-cms and persistent messages, and  I saw
>> that
>> my memory consumption was increasing for every each message that I send.
>> The
>> same example with NON_PERSISTENT delivery mode flag doesn't loose any
>> memory. 
>> Valgrind with the example of your web and PERSISTENT flag on:
>> 
>> -----------------------------------------------------                            
>> Finished with the example.                                                       
>> =====================================================                            
>> ==6141==                                                                         
>> ==6141== HEAP SUMMARY:
>> ==6141==     in use at exit: 1,750,846 bytes in 50,014 blocks
>> ==6141==   total heap usage: 317,727 allocs, 267,713 frees, 31,314,995
>> bytes
>> allocated
>> ==6141==
>> ==6141== LEAK SUMMARY:
>> ==6141==    definitely lost: 677,572 bytes in 3,999 blocks
>> ==6141==    indirectly lost: 1,071,561 bytes in 45,977 blocks
>> ==6141==      possibly lost: 1,685 bytes in 37 blocks
>> ==6141==    still reachable: 28 bytes in 1 blocks
>> ==6141==         suppressed: 0 bytes in 0 blocks
>> ==6141== Rerun with --leak-check=full to see details of leaked memory
>> ==6141==
>> ==6141== For counts of detected and suppressed errors, rerun with: -v
>> ==6141== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 37 from 6)
>> 
>> 
>> Perhaps it's something about the acknowledge? 
>> 
>> 
>> 
>> regards
>> 
> 
> What version are you using of ActiveMQ-CPP ?
> 
> Can you provide a sample app that demonstrates this issue?
> 
> Regards
> 
> -- 
> Tim Bish
> 
> Open Source Integration: http://fusesource.com
> ActiveMQ in Action: http://www.manning.com/snyder/
> 
> Follow me on Twitter: http://twitter.com/tabish121
> My Blog: http://timbish.blogspot.com/
> 
> 
> 

-- 
View this message in context: http://old.nabble.com/ActiveMQ-CPP%3A-memory-leak-with-persistent-sendings--tp27716173p27717254.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: ActiveMQ-CPP: memory leak with persistent sendings?

Posted by Timothy Bish <ta...@gmail.com>.
On Fri, 2010-02-26 at 01:35 -0800, opernas wrote:
> Hi all,
> 
> 
> I was making test with activemq-cms and persistent messages, and  I saw that
> my memory consumption was increasing for every each message that I send. The
> same example with NON_PERSISTENT delivery mode flag doesn't loose any
> memory. 
> Valgrind with the example of your web and PERSISTENT flag on:
> 
> -----------------------------------------------------                            
> Finished with the example.                                                       
> =====================================================                            
> ==6141==                                                                         
> ==6141== HEAP SUMMARY:
> ==6141==     in use at exit: 1,750,846 bytes in 50,014 blocks
> ==6141==   total heap usage: 317,727 allocs, 267,713 frees, 31,314,995 bytes
> allocated
> ==6141==
> ==6141== LEAK SUMMARY:
> ==6141==    definitely lost: 677,572 bytes in 3,999 blocks
> ==6141==    indirectly lost: 1,071,561 bytes in 45,977 blocks
> ==6141==      possibly lost: 1,685 bytes in 37 blocks
> ==6141==    still reachable: 28 bytes in 1 blocks
> ==6141==         suppressed: 0 bytes in 0 blocks
> ==6141== Rerun with --leak-check=full to see details of leaked memory
> ==6141==
> ==6141== For counts of detected and suppressed errors, rerun with: -v
> ==6141== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 37 from 6)
> 
> 
> Perhaps it's something about the acknowledge? 
> 
> 
> 
> regards
> 

What version are you using of ActiveMQ-CPP ?

Can you provide a sample app that demonstrates this issue?

Regards

-- 
Tim Bish

Open Source Integration: http://fusesource.com
ActiveMQ in Action: http://www.manning.com/snyder/

Follow me on Twitter: http://twitter.com/tabish121
My Blog: http://timbish.blogspot.com/