[
https://issues.apache.org/activemq/browse/AMQCPP-121?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_39221
]
Timothy Bish commented on AMQCPP-121:
-------------------------------------
I've run your test code against a 4.1.1 broker, this is the command tracing.
As far as I can tell we get two responses one for the ConnectionInfo, and one
for the SessionInfo. In each case the response is cleaned up right after the
response is received. The response correlator removes the futureResponse
objects before request returns, so they are gone as well.
Is this the same as what you see when you run? I'm on Linux BTW.
INFO: *** BEGIN SENDING ONEWAY COMMAND ***
Begin Class = WireFormatInfo
Value of properties = Begin Class PrimitiveMap:
map[CacheEnabled] = 0
map[SizePrefixDisabled] = 0
map[StackTraceEnabled] = 0
map[TcpNoDelayEnabled] = 0
map[TightEncodingEnabled] = 0
Begin Class PrimitiveMap:
Value of version = 2
Value of stackTraceEnabled = 0
Value of tcpNoDelayEnabled = 0
Value of cacheEnabled = 0
Value of tightEncodingEnabled = 0
Value of sizePrefixDisabled = 0
Begin Class = BaseCommand
No Data for Class BaseDataStructure
Response Required = 0
Command Id = 0
End Class = BaseCommand
End Class = WireFormatInfo
*** END SENDING ONEWAY COMMAND *** - tid: 3086636752
INFO: *** BEGIN RECEIVED ASYNCHRONOUS COMMAND ***
Begin Class = WireFormatInfo
Value of properties = Begin Class PrimitiveMap:
map[CacheEnabled] = 1
map[CacheSize] = 1024
map[MaxInactivityDuration] = 30000
map[SizePrefixDisabled] = 0
map[StackTraceEnabled] = 1
map[TcpNoDelayEnabled] = 1
map[TightEncodingEnabled] = 1
Begin Class PrimitiveMap:
Value of version = 2
Value of stackTraceEnabled = 1
Value of tcpNoDelayEnabled = 1
Value of cacheEnabled = 1
Value of tightEncodingEnabled = 1
Value of sizePrefixDisabled = 0
Begin Class = BaseCommand
No Data for Class BaseDataStructure
Response Required = 0
Command Id = 0
End Class = BaseCommand
End Class = WireFormatInfo
*** END RECEIVED ASYNCHRONOUS COMMAND *** - tid: 3086633872
INFO: *** BEGIN RECEIVED ASYNCHRONOUS COMMAND ***
Begin Class = BrokerInfo
Value of BrokerInfo::ID_BROKERINFO = 2
Value of BrokerId is Below:
Begin Class = BrokerId
Value of BrokerId::ID_BROKERID = 124
Value of Value = ID:tbish-laptop.ats.sensis.com-45300-1180967363068-1:0
No Data for Class BaseDataStructure
End Class = BrokerId
Value of BrokerURL = tcp://tbish-laptop.ats.sensis.com:61616
Value of BrokerName = localhost
Value of SlaveBroker = 0
Value of MasterBroker = 0
Value of FaultTolerantConfiguration = 0
Value of DuplexConnection = 0
Value of NetworkConnection = 0
Value of ConnectionId = 0
Begin Class = BaseCommand
No Data for Class BaseDataStructure
Response Required = 0
Command Id = 0
End Class = BaseCommand
End Class = BrokerInfo
*** END RECEIVED ASYNCHRONOUS COMMAND *** - tid: 3086633872
INFO: *** SENDING REQUEST COMMAND ***
Begin Class = ConnectionInfo
Value of ConnectionInfo::ID_CONNECTIONINFO = 3
Value of ConnectionId is Below:
Begin Class = ConnectionId
Value of ConnectionId::ID_CONNECTIONID = 120
Value of Value = e9a25907-7b2e-4b29-a148-21493cb3838f
No Data for Class BaseDataStructure
End Class = ConnectionId
Value of ClientId = c9025ac2-0d2d-4256-b3d1-26dc2b77d559
Value of Password =
Value of UserName =
Value of BrokerMasterConnector = 0
Value of Manageable = 0
Value of ClientMaster = 0
Begin Class = BaseCommand
No Data for Class BaseDataStructure
Response Required = 1
Command Id = 2
End Class = BaseCommand
End Class = ConnectionInfo
*** RECEIVED RESPONSE COMMAND ***
Begin Class = Response
Value of Response::ID_RESPONSE = 30
Value of CorrelationId = 2
Begin Class = BaseCommand
No Data for Class BaseDataStructure
Response Required = 0
Command Id = 0
End Class = BaseCommand
End Class = Response
- tid: 3086636752
INFO: *** SENDING REQUEST COMMAND ***
Begin Class = SessionInfo
Value of SessionInfo::ID_SESSIONINFO = 4
Value of SessionId is Below:
Begin Class = SessionId
Value of SessionId::ID_SESSIONID = 121
Value of ConnectionId = e9a25907-7b2e-4b29-a148-21493cb3838f
Value of Value = 1
No Data for Class BaseDataStructure
End Class = SessionId
Begin Class = BaseCommand
No Data for Class BaseDataStructure
Response Required = 1
Command Id = 3
End Class = BaseCommand
End Class = SessionInfo
*** RECEIVED RESPONSE COMMAND ***
Begin Class = Response
Value of Response::ID_RESPONSE = 30
Value of CorrelationId = 3
Begin Class = BaseCommand
No Data for Class BaseDataStructure
Response Required = 0
Command Id = 0
End Class = BaseCommand
End Class = Response
- tid: 3086636752
INFO: *** BEGIN SENDING ONEWAY COMMAND ***
Begin Class = RemoveInfo
Value of RemoveInfo::ID_REMOVEINFO = 12
Value of ObjectId is Below:
Begin Class = SessionId
Value of SessionId::ID_SESSIONID = 121
Value of ConnectionId = e9a25907-7b2e-4b29-a148-21493cb3838f
Value of Value = 1
No Data for Class BaseDataStructure
End Class = SessionId
Begin Class = BaseCommand
No Data for Class BaseDataStructure
Response Required = 0
Command Id = 0
End Class = BaseCommand
End Class = RemoveInfo
*** END SENDING ONEWAY COMMAND *** - tid: 3086636752
INFO: *** BEGIN SENDING ONEWAY COMMAND ***
Begin Class = RemoveInfo
Value of RemoveInfo::ID_REMOVEINFO = 12
Value of ObjectId is Below:
Begin Class = ConnectionId
Value of ConnectionId::ID_CONNECTIONID = 120
Value of Value = e9a25907-7b2e-4b29-a148-21493cb3838f
No Data for Class BaseDataStructure
End Class = ConnectionId
Begin Class = BaseCommand
No Data for Class BaseDataStructure
Response Required = 0
Command Id = 0
End Class = BaseCommand
End Class = RemoveInfo
*** END SENDING ONEWAY COMMAND *** - tid: 3086636752
INFO: *** BEGIN SENDING ONEWAY COMMAND ***
Begin Class = ShutdownInfo
Value of ShutdownInfo::ID_SHUTDOWNINFO = 11
Begin Class = BaseCommand
No Data for Class BaseDataStructure
Response Required = 0
Command Id = 0
End Class = BaseCommand
End Class = ShutdownInfo
*** END SENDING ONEWAY COMMAND *** - tid: 3086636752
> Possible memory leak in activemq::transport::IOTransport::run
> -------------------------------------------------------------
>
> Key: AMQCPP-121
> URL: https://issues.apache.org/activemq/browse/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*)
> (OpenWireFormat.cpp:239)
> ==20739== by 0x46A48C9:
> activemq::connector::openwire::OpenWireFormat::unmarshal(activemq::io::DataInputStream*)
> (OpenWireFormat.cpp:185)
> ==20739== by 0x46A6E5D:
> activemq::connector::openwire::OpenWireCommandReader::readCommand()
> (OpenWireCommandReader.cpp:71)
> ==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/libpthread-2.5.so)
> ==20739== by 0x3F026D: clone (in /lib/libc-2.5.so)
> The code looks like this:
> void IOTransport::run(){
> try{
> 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.