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.<br><br>Bryan<br><br><div class="gmail_quote">On Thu, Mar 18, 2010 at 1:19 PM, Bryan Murphy <span dir="ltr"><<a href="mailto:bmurphy1976@gmail.com">bmurphy1976@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">Sometime between 1.7.0 and 1.7.1 (revision 262) the following line was added to ConnectionBase.MainLoop in the RabbitMQ .NET driver:<br>
<br> Thread.GetDomain().DomainUnload += new EventHandler(HandleDomainUnload);<br><br>
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:<br>
<br> DomainUnload -> Connection -> SocketFrameHandler -> NetworkBinaryReader/Writer -> BufferedStream<br><br>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.<br>
<br>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.<br>
<br>Thanks,<br><font color="#888888">Bryan<br>
</font></blockquote></div><br>