Chuck Rolke created QPID-5951:
---------------------------------
Summary: C++ Broker Amqp1.0 memory leak
Key: QPID-5951
URL: https://issues.apache.org/jira/browse/QPID-5951
Project: Qpid
Issue Type: Bug
Components: C++ Broker
Affects Versions: 0.28
Environment: Linux Fedora 19 and Windows Server 2012 R2
Reporter: Chuck Rolke
Running the stock C++ example HelloWorld leaks memory in AMQP1.0. Using the
same broker/client things are normal using AMQP0-10.
The client runs
{noformat}
for i in {1..20}; do ./hello_world localhost:5672 amq.topic; done
{noformat}
Valgrind qpidd shows:
{noformat}
$ ~/svn/qpid/build/src> valgrind ./qpidd --auth no --no-data-dir --load-module
amqp.so
==8881== Memcheck, a memory error detector
==8881== Copyright (C) 2002-2012, and GNU GPL'd, by Julian Seward et al.
==8881== Using Valgrind-3.8.1 and LibVEX; rerun with -h for copyright info
==8881== Command: ./qpidd --auth no --no-data-dir --load-module amqp.so
==8881==
2014-07-31 17:01:59 [Broker] notice Broker 8881 initializing
2014-07-31 17:01:59 [Security] notice SSL plugin not enabled, you must set
--ssl-cert-db to enable it.
2014-07-31 17:02:00 [Broker] notice SASL disabled: No Authentication Performed
2014-07-31 17:02:00 [Network] notice Listening on TCP/TCP6 port 5672
2014-07-31 17:02:00 [Broker] notice Broker 8881 initialized
2014-07-31 17:02:00 [Broker] notice Broker 8881 running
^C2014-07-31 17:02:21 [Broker] notice Broker 8881 stopped
2014-07-31 17:02:21 [Broker] notice Broker 8881 shutting down
2014-07-31 17:02:21 [Broker] notice Broker 8881 shutdown complete
==8881==
==8881== HEAP SUMMARY:
==8881== in use at exit: 18,073 bytes in 50 blocks
==8881== total heap usage: 139,591 allocs, 139,541 frees, 11,839,443 bytes
allocated
==8881==
==8881== LEAK SUMMARY:
==8881== definitely lost: 0 bytes in 0 blocks
==8881== indirectly lost: 0 bytes in 0 blocks
==8881== possibly lost: 0 bytes in 0 blocks
==8881== still reachable: 18,073 bytes in 50 blocks
==8881== suppressed: 0 bytes in 0 blocks
==8881== Rerun with --leak-check=full to see details of leaked memory
==8881==
==8881== For counts of detected and suppressed errors, rerun with: -v
==8881== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 2 from 2)
{noformat}
This looks normal. However, when the client runs:
{noformat}
for i in {1..20}; do ./hello_world localhost:5672 amq.topic
"{protocol:amqp1.0}"; done
{noformat}
The broker shows:
{noformat}
$ ~/svn/qpid/build/src> valgrind ./qpidd --auth no --no-data-dir --load-module
amqp.so
==8940== Memcheck, a memory error detector
==8940== Copyright (C) 2002-2012, and GNU GPL'd, by Julian Seward et al.
==8940== Using Valgrind-3.8.1 and LibVEX; rerun with -h for copyright info
==8940== Command: ./qpidd --auth no --no-data-dir --load-module amqp.so
==8940==
2014-07-31 17:02:29 [Broker] notice Broker 8940 initializing
2014-07-31 17:02:29 [Security] notice SSL plugin not enabled, you must set
--ssl-cert-db to enable it.
2014-07-31 17:02:30 [Broker] notice SASL disabled: No Authentication Performed
2014-07-31 17:02:30 [Network] notice Listening on TCP/TCP6 port 5672
2014-07-31 17:02:30 [Broker] notice Broker 8940 initialized
2014-07-31 17:02:30 [Broker] notice Broker 8940 running
^C2014-07-31 17:02:45 [Broker] notice Broker 8940 stopped
2014-07-31 17:02:45 [Broker] notice Broker 8940 shutting down
2014-07-31 17:02:45 [Broker] notice Broker 8940 shutdown complete
==8940==
==8940== HEAP SUMMARY:
==8940== in use at exit: 494,713 bytes in 10,190 blocks
==8940== total heap usage: 150,536 allocs, 140,346 frees, 26,113,574 bytes
allocated
==8940==
==8940== LEAK SUMMARY:
==8940== definitely lost: 4,888 bytes in 20 blocks
==8940== indirectly lost: 471,240 bytes in 10,119 blocks
==8940== possibly lost: 512 bytes in 1 blocks
==8940== still reachable: 18,073 bytes in 50 blocks
==8940== suppressed: 0 bytes in 0 blocks
==8940== Rerun with --leak-check=full to see details of leaked memory
==8940==
==8940== For counts of detected and suppressed errors, rerun with: -v
==8940== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 2 from 2)
{noformat}
It seems to be leaking 20Kbytes per message on Fedora. On Windows the number is
slightly higher.
--
This message was sent by Atlassian JIRA
(v6.2#6252)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]