[jira] Updated: (QPID-1952) C++: client request memory leak on windows
[ https://issues.apache.org/jira/browse/QPID-1952?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Steve Huston updated QPID-1952: --- Attachment: AsynchIO.cpp.diff David, could you please try the attached AsynchIO.cpp.diff with your test case? It goes back to your original diagnosis that the issue is in AsynchIO.cpp - my other fix took care of the broker cases, but left a leak with the client where the operations are done in reverse order, usually. > C++: client request memory leak on windows > -- > > Key: QPID-1952 > URL: https://issues.apache.org/jira/browse/QPID-1952 > Project: Qpid > Issue Type: Bug > Components: C++ Client >Affects Versions: 0.5 > Environment: Windows XP Pro w/SP3 >Reporter: David Rennalls > Attachments: AsynchIO.cpp.diff, Connector_memory_leak.patch, Main2.cpp > > > I'm experiencing a memory leak when using the client library on Windows (0.5 > release) when sending a single request. From what debugging I've done so far > it looks like the The AsynchIO object used by the TCPConnector is not being > deleted. When the connection is being closed aio->queueForDeletion() is > called from TCPConnector::closeInternal().. However in > AsynchIO::queueForDeletion() aio.opsInProgress > 0 so the 'delete this' > branch is not done. There are no more queueForDeletion() calls made on the > aio object (after opsInProgress is 0) and so it never gets deleted. The > ConnectionImpl object involved is not cleaned up either, the shared_ptr to it > has a non-zero ref count but I'm guessing it's related to the AsynchIO object > not being cleaned up. > There used to be some code in AsynchIO::completion() that seems like it would > do the necessary delete (see below). It was removed with code changes in > https://issues.apache.org/jira/browse/QPID-1550 because 'It fixed a memory > corruption on the broker side by deleting too early' (from Steve H.) > -// Lock released; ok to delete if all is done. > -if (opsInProgress == 0 && queuedDelete) > -delete this; -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. - Apache Qpid - AMQP Messaging Implementation Project: http://qpid.apache.org Use/Interact: mailto:dev-subscr...@qpid.apache.org
[jira] Updated: (QPID-1952) C++: client request memory leak on windows
[ https://issues.apache.org/jira/browse/QPID-1952?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] David Rennalls updated QPID-1952: - Attachment: Connector_memory_leak.patch This fixed the leak for me. I'm only using the client library and don't know if this leak exists in the broker's usage. > C++: client request memory leak on windows > -- > > Key: QPID-1952 > URL: https://issues.apache.org/jira/browse/QPID-1952 > Project: Qpid > Issue Type: Bug > Components: C++ Client >Affects Versions: 0.5 > Environment: Windows XP Pro w/SP3 >Reporter: David Rennalls > Attachments: Connector_memory_leak.patch, Main2.cpp > > > I'm experiencing a memory leak when using the client library on Windows (0.5 > release) when sending a single request. From what debugging I've done so far > it looks like the The AsynchIO object used by the TCPConnector is not being > deleted. When the connection is being closed aio->queueForDeletion() is > called from TCPConnector::closeInternal().. However in > AsynchIO::queueForDeletion() aio.opsInProgress > 0 so the 'delete this' > branch is not done. There are no more queueForDeletion() calls made on the > aio object (after opsInProgress is 0) and so it never gets deleted. The > ConnectionImpl object involved is not cleaned up either, the shared_ptr to it > has a non-zero ref count but I'm guessing it's related to the AsynchIO object > not being cleaned up. > There used to be some code in AsynchIO::completion() that seems like it would > do the necessary delete (see below). It was removed with code changes in > https://issues.apache.org/jira/browse/QPID-1550 because 'It fixed a memory > corruption on the broker side by deleting too early' (from Steve H.) > -// Lock released; ok to delete if all is done. > -if (opsInProgress == 0 && queuedDelete) > -delete this; -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. - Apache Qpid - AMQP Messaging Implementation Project: http://qpid.apache.org Use/Interact: mailto:dev-subscr...@qpid.apache.org
[jira] Updated: (QPID-1952) C++: client request memory leak on windows
[ https://issues.apache.org/jira/browse/QPID-1952?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] David Rennalls updated QPID-1952: - Attachment: Main2.cpp Test code that exhibits the problem. This was run against a local broker (using .exe from http://www.apache.org/dist/qpid/0.5-windows/qpidc-0.5.msi) with no queues defined etc.. just needs a working broker to accept the request. The real code where the queue is defined and a response is received etc. has the same problem > C++: client request memory leak on windows > -- > > Key: QPID-1952 > URL: https://issues.apache.org/jira/browse/QPID-1952 > Project: Qpid > Issue Type: Bug > Components: C++ Client >Affects Versions: 0.5 > Environment: Windows XP Pro w/SP3 >Reporter: David Rennalls > Attachments: Main2.cpp > > > I'm experiencing a memory leak when using the client library on Windows (0.5 > release) when sending a single request. From what debugging I've done so far > it looks like the The AsynchIO object used by the TCPConnector is not being > deleted. When the connection is being closed aio->queueForDeletion() is > called from TCPConnector::closeInternal().. However in > AsynchIO::queueForDeletion() aio.opsInProgress > 0 so the 'delete this' > branch is not done. There are no more queueForDeletion() calls made on the > aio object (after opsInProgress is 0) and so it never gets deleted. The > ConnectionImpl object involved is not cleaned up either, the shared_ptr to it > has a non-zero ref count but I'm guessing it's related to the AsynchIO object > not being cleaned up. > There used to be some code in AsynchIO::completion() that seems like it would > do the necessary delete (see below). It was removed with code changes in > https://issues.apache.org/jira/browse/QPID-1550 because 'It fixed a memory > corruption on the broker side by deleting too early' (from Steve H.) > -// Lock released; ok to delete if all is done. > -if (opsInProgress == 0 && queuedDelete) > -delete this; -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. - Apache Qpid - AMQP Messaging Implementation Project: http://qpid.apache.org Use/Interact: mailto:dev-subscr...@qpid.apache.org