[rabbitmq-discuss] [rabbitmq-c-master] memory leakinkg while reconnect.
Alan Antonuk
alan.antonuk at gmail.com
Wed Feb 12 16:36:08 GMT 2014
You appear to be doing things correctly.
Could you try running your program under valgrind to see if it reports
anything?
-Alan
On Tue, Feb 11, 2014 at 10:02 PM, Rohit Patle
<Rohit.Patle at techmahindra.com>wrote:
> 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.
>
> while(1)
> {
> 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");
> amqp_destroy_connection(conn);
> }
> else
> break;
> }
>
> 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,
> Rohit
>
> ------------------------------
>
> DISCLAIMER:
> 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.
>
> _______________________________________________
> rabbitmq-discuss mailing list
> rabbitmq-discuss at lists.rabbitmq.com
> https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20140212/7af21020/attachment.html>
More information about the rabbitmq-discuss
mailing list