Suspected missing ArrayPool memory return with high transmission load with .NET Client, starting from 6.1.0

63 views
Skip to first unread message

Gianluca Tornese

unread,
Feb 16, 2021, 10:07:18 AM2/16/21
to rabbitmq-users
Hi there,

I've implemented a very basic scenario in which a publisher node transmits a high number of messages (configurable, in the attached example 15K/sec), and another node consumes on the target queue (one consumer, auto-ack).

Starting from RabbitMQ .NET Client 6.1.0 I can see the memory steadily and consistently ramps up, as in attached screenshots.

By building and playing around with the source code directly, I managed to see that the amount of memory rented by RabbitMQ.Client/client/impl/OutgoingCommand.cs#L69 is higher than the amount returned by RabbitMQ.Client/client/impl/SocketFrameHandler.cs#L294

Please note that the memory leak i detect is on the client side only, nothing bad happens on the broker side (queue does not pile up messages).

As mentioned, no such behaviour with version 6.0.0 (that did not rely on array pools and renting?).

RabbitMQ Broker is version 3.8.9.

Cannot reproduce this behaviour with a low transmission load.

Thanks for your help, and please let me know if I can provide additional info, and whether this is eligible to be reported as an issue.

Regards,

Gianluca
Consumer.cs
Publisher.cs
Diagnostic_memory.png
Program.cs

Silvia Tosi

unread,
Sep 14, 2021, 11:53:31 AM9/14/21
to rabbitmq-users
Hi,

I have found the same issue mentioned by Gianluca by using rabbitmq client .Net Core 5 and the issue can be reproduced from 6.1.0 version and up. 
I will move my application to version 6.0.0.

In attachments a simple test application that reproduce the problem. Just needed to move the reference of the version to see the result. 
I think it is about some Channel object 
I am running on 

Windows Version 10.0.19043 Build 19043
RabbitMQ 3.8.16
Erlang 24.0.1

(I have tried the bash for environment but I didn't manage to run it)

Best regards,
Silvia
Program.cs
Reply all
Reply to author
Forward
0 new messages