[rabbitmq-discuss] Memory Leak in RabbitMQ .NET Driver v1.7.1+
Bryan Murphy
bmurphy1976 at gmail.com
Thu Mar 18 20:01:51 GMT 2010
I just shut down the profiler in our production environment after running
for a few hours. I can confirm that removing this line does in fact resolve
our memory leak.
Bryan
On Thu, Mar 18, 2010 at 1:19 PM, Bryan Murphy <bmurphy1976 at gmail.com> wrote:
> Sometime between 1.7.0 and 1.7.1 (revision 262) the following line was
> added to ConnectionBase.MainLoop in the RabbitMQ .NET driver:
>
> Thread.GetDomain().DomainUnload += new EventHandler(HandleDomainUnload);
>
> I've found no place in the code where this event is unregistered, leading
> to a memory leak every time a connection is disposed. The following
> reference chain compounds this problem if you send large messages and
> create/dispose a large number of connections:
>
> DomainUnload -> Connection -> SocketFrameHandler ->
> NetworkBinaryReader/Writer -> BufferedStream
>
> We're currently seeing the symptoms of this in our production environment
> where one of our processes (which usually settles in around 300mb) grows
> upwards of 4gig over a 12 to 18 hour period.
>
> I believe you can work around this by either rolling back to the 1.7.0
> driver, or commenting out that line of code. We're currently pushing out a
> custom build of the driver to verify this fix, but it will be a few hours
> until I know for sure.
>
> Thanks,
> Bryan
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20100318/09c4282f/attachment.htm
More information about the rabbitmq-discuss
mailing list