activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Albert Strasheim (JIRA)" <>
Subject [jira] Created: (AMQCPP-121) Possible memory leak in activemq::transport::IOTransport::run
Date Sat, 02 Jun 2007 22:47:32 GMT
Possible memory leak in activemq::transport::IOTransport::run

                 Key: AMQCPP-121
             Project: ActiveMQ C++ Client
          Issue Type: Bug
    Affects Versions: 2.1
            Reporter: Albert Strasheim
            Assignee: Nathan Mittler
             Fix For: 2.1

There might be a memory leak in activemq::transport::IOTransport::run.

Valgrind says:

==20739== 20 bytes in 1 blocks are definitely lost in loss record 126 of 175
==20739==    at 0x4005BA5: operator new(unsigned) (vg_replace_malloc.c:163)
==20739==    by 0x4776995: activemq::connector::openwire::marshal::v2::ResponseMarshaller::createObject()
const (ResponseMarshaller.cpp:40)
==20739==    by 0x46A433B: activemq::connector::openwire::OpenWireFormat::doUnmarshal(activemq::io::DataInputStream*)
==20739==    by 0x46A48C9: activemq::connector::openwire::OpenWireFormat::unmarshal(activemq::io::DataInputStream*)
==20739==    by 0x46A6E5D: activemq::connector::openwire::OpenWireCommandReader::readCommand()
==20739==    by 0x46D3857: activemq::transport::IOTransport::run() (IOTransport.cpp:166)
==20739==    by 0x4667DE7: activemq::concurrent::Thread::runCallback(void*) (Thread.cpp:152)
==20739==    by 0x4963DA: start_thread (in /lib/
==20739==    by 0x3F026D: clone (in /lib/

The code looks like this:

void IOTransport::run(){
        while( !closed ){
            Command* command = reader->readCommand();
            fire( command );
    catch( exceptions::ActiveMQException& ex ){ /*...*/ }
    catch( ... ){ /*...*/ }

What might be happening here is that readCommand succeeds but that fire throws an exception
for some reason. If this happens, command won't be freed.

Not quite sure under what circumstances this happens. If you're not convinced, I can try to
narrow down the code that causes the leak.

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message