[rabbitmq-discuss] [rabbitmq-c-master] memory leakinkg while reconnect.

Rohit Patle Rohit.Patle at techmahindra.com
Wed Feb 12 06:02:27 GMT 2014

Hi Alan,

Thank you for your reply. Sure I will take care of addressing my mail to rabbitmq-discuss only.

Here is our observation.
1. Network cable is pulled off from my system.
2. The listener program is in a while loop trying to reconnect to RMQ broker.
3. Following are the set of APIs called in this while loop.

   conn = amqp_new_connection();

  socket = amqp_ssl_socket_new(conn);
  if (!socket) {
    printf("creating SSL/TLS socket");
    exit (0);

  if (argc > 5) {
    status = amqp_ssl_socket_set_cacert(socket, argv[5]);
    if (status) {
      printf("setting CA certificate");
      exit (0);

  if (argc > 7) {
    status = amqp_ssl_socket_set_key(socket, argv[7], argv[6]);
    if (status) {
      printf("setting client cert");
      exit (0);
  amqp_ssl_socket_set_verify(socket, 0);
  status = amqp_socket_open(socket, hostname, port);
  if (status) {
    printf("opening SSL/TLS connection");

4. As network cable is removed from my system before running this test program, I getting "opening SSL/TLS connection" which is a valid error (status value -9). However amqp_destroy_connection() API is not releasing the resources allocated during amqp_new_connection() API call. Could you please confirm the behaviour of amqp_destroy_connection() API when there is no network cable attached to the system? There is memory leak happening due to this API.

How to destroy the amqp_connection_state_t object created during amqp_new_connection()?

Please suggest.

Thanks & Regards,


This email (including any attachments) is intended for the sole use of the intended recipient/s and may contain material that is CONFIDENTIAL AND PRIVATE COMPANY INFORMATION. Any review or reliance by others or copying or distribution or forwarding of any or all of the contents in this message is STRICTLY PROHIBITED. If you are not the intended recipient, please contact the sender by email and delete all copies; your cooperation in this regard is appreciated.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20140212/6ee223ec/attachment.html>

More information about the rabbitmq-discuss mailing list