Heap memory contains 6.3 million of string objects like this: amq.ctag-QyDNazNXZdatTGscA8QWrw #1797
Replies: 2 comments
-
This repository is about the server side, so RabbitMQ as a broker. |
Beta Was this translation helpful? Give feedback.
-
@gabrieltarpian25 - I've moved this issue to the correct repository. You are missing basic information in your issue report:
Once you provide the above, I can assist you. Other notes:
Yes, that is the correct way to remove an event handler in C#.
How am I supposed to confirm this without seeing how you use this library? After a quick review I can't see where this library would hold on to a consumer tag for a long period of time in |
Beta Was this translation helpful? Give feedback.
-
Describe the bug
Hello, everyone. I have multiple microservices that communicates each other with RabbitMQ. I have discovered that my application is having high memory usage that keeps growing. I have analyzed its dump and I found that, on the heap memory, I have 437 MB used by around 6.3 million of string objects like this:
amq.ctag-QyDNazNXZdatTGscA8QWrw
This is the consumer tag. I am not storing it on the heap, it's just within the local scope in a string variable, so I am pretty sure the Garbage Collector will dispose it. I am creating a consumer for each RPC request, like this:
And cancel it like this:
From my research, it seems the consumer was disposed but not its handler and that's why its tag stays in the memory. Could you please confirm that is the case? Also, should I replace
with
Thank you!
Beta Was this translation helpful? Give feedback.
All reactions