Re: [Quickfix-users] Memory Leak - Please help.
Brought to you by:
orenmnero
From: <or...@qu...> - 2008-04-04 16:17:42
|
<html><body><div>Sort of. The problem is that memory allocated in C++ does not get reported to the garbage collector, so it doesn't realize how much memory has been allocated. With the code in subversion we add memory pressure to the GC for each allocated message which should help. If you get the latest from svn you can take advantage of it.</div> <div> </div> <div>--oren</div> <BLOCKQUOTE style="PADDING-LEFT: 8px; MARGIN-LEFT: 8px; BORDER-LEFT: blue 2px solid" webmail="1">-------- Original Message --------<BR>Subject: Re: [Quickfix-users] Memory Leak - Please help.<BR>From: James P Michels III <jmi...@bl...><BR>Date: Thu, April 03, 2008 3:31 pm<BR>To: <a href="mailto:Qui...@li...">Qui...@li...</a><BR><BR>QuickFIX Documentation: <A href="http://www.quickfixengine.org/quickfix/doc/html/index.html" target=_blank><a href="http://www.quickfixengine.org/quickfix/doc/html/index.html">http://www.quickfixengine.org/quickfix/doc/html/index.html</a></A><BR>QuickFIX Support: <A href="http://www.quickfixengine.org/services.html" target=_blank><a href="http://www.quickfixengine.org/services.html">http://www.quickfixengine.org/services.html</a></A><BR><BR> <HR> -"We don't know when you are done with the message"<BR><BR>Isn't the whole point of a garbage collected runtime to deal with this problem?<BR><BR>OK, I get that its good form to call Dispose, but why is this required?<BR><BR>Doesn't Dispose get called when these objects are being garbage collected?<BR><BR><A class=moz-txt-link-abbreviated onclick="Popup.composeWindow('pcompose.php?sendto=oren%40quickfixengine.org');; return false;" href="mailto:or...@qu..." target=_blank><a href="mailto:or...@qu...">or...@qu...</a></A> wrote: <BLOCKQUOTE cite=mid:200...@em... type="cite"><PRE wrap="">QuickFIX Documentation: <A class=moz-txt-link-freetext href="http://www.quickfixengine.org/quickfix/doc/html/index.html" target=_blank><a href="http://www.quickfixengine.org/quickfix/doc/html/index.html">http://www.quickfixengine.org/quickfix/doc/html/index.html</a></A> QuickFIX Support: <A class=moz-txt-link-freetext href="http://www.quickfixengine.org/services.html" target=_blank><a href="http://www.quickfixengine.org/services.html">http://www.quickfixengine.org/services.html</a></A> </PRE><BR> <HR width="90%" SIZE=4> <BR> <DIV>We don't know when you are done with the message. You need to call Dispose when you are finished with it.</DIV> <DIV> </DIV> <DIV>--oren</DIV> <BLOCKQUOTE style="PADDING-LEFT: 8px; MARGIN-LEFT: 8px; BORDER-LEFT: blue 2px solid" webmail="1">-------- Original Message --------<BR>Subject: [Quickfix-users] Memory Leak - Please help.<BR>From: "Sam Smith" <A class=moz-txt-link-rfc2396E onclick="Popup.composeWindow('pcompose.php?sendto=sam%40if5.com');; return false;" href="mailto:sa...@if..." target=_blank><sa...@if...></A><BR>Date: Thu, March 20, 2008 6:37 am<BR>To: <<A onclick="Popup.composeWindow('pcompose.php?sendto=quickfix-users%40lists.sourceforge');; return false;" href="mailto:qui...@li...urceforge" target=_blank moz-do-not-send="true"><a href="mailto:qui...@li...urceforge">qui...@li...urceforge</a></A>.net><BR><BR>QuickFIX Documentation: <A href="http://www.quickfixengine.org/quickfix/doc/html/index.html" target=_blank moz-do-not-send="true"><a href="http://www.quickfixengine.org/quickfix/doc/html/index.html">http://www.quickfixengine.org/quickfix/doc/html/index.html</a></A><BR>QuickFIX Support: <A href="http://www.quickfixengine.org/services.html" target=_blank moz-do-not-send="true"><a href="http://www.quickfixengine.org/services.html">http://www.quickfixengine.org/services.html</a></A><BR><BR> <HR> <o:SmartTagType name="City" namespaceuri="urn:schemas-microsoft-com:office:smarttags"></o:SmartTagType><o:SmartTagType name="place" namespaceuri="urn:schemas-microsoft-com:office:smarttags"></o:SmartTagType> <STYLE> #wmMessage #wmMessage st1\:* {behavior:url(#default#ieooui) } </STYLE> <STYLE> #wmMessage #wmMessage /* Style Definitions */ p.MsoNormal, #wmMessage #wmMessage li.MsoNormal, #wmMessage #wmMessage div.MsoNormal {margin:0cm; margin-bottom:.0001pt; font-size:12.0pt; font-family:"Times New Roman";} #wmMessage #wmMessage a:link, #wmMessage #wmMessage span.MsoHyperlink {color:blue; text-decoration:underline;} #wmMessage #wmMessage a:visited, #wmMessage #wmMessage span.MsoHyperlinkFollowed {color:purple; text-decoration:underline;} #wmMessage #wmMessage span.EmailStyle17 {mso-style-type:personal-compose; font-family:Arial; color:windowtext;} #wmMessage #wmMessage @page Section1 {size:595.3pt 841.9pt; margin:72.0pt 90.0pt 72.0pt 90.0pt;} #wmMessage #wmMessage div.Section1 {page:Section1;} </STYLE> <DIV class=Section1> <DIV><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Hi,<o:p></o:p></SPAN></FONT></DIV> <DIV><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><o:p> </o:p></SPAN></FONT></DIV> <DIV><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">I am reasonably new to QuickFix and I have a problem. I have been asked to look at part of a C# application using the .Net QuickFixEngine library.<o:p></o:p></SPAN></FONT></DIV> <DIV><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><o:p> </o:p></SPAN></FONT></DIV> <DIV><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">My problem is that the application seems to have substantial memory leak.<o:p></o:p></SPAN></FONT></DIV> <DIV><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><o:p> </o:p></SPAN></FONT></DIV> <DIV><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Looking at the application using a .Net memory profiler, it looks like a lot of QuickFix objects are hanging around in memory. It looks like the .Net code is releasing all references to the objects, but some unmanaged code is retaining a reference.<o:p></o:p></SPAN></FONT></DIV> <DIV><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><o:p> </o:p></SPAN></FONT></DIV> <DIV><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Am I missing something obvious? Should the developers who wrote it have been calling a .Dispose method or delete or something on these objects? One major source of the leak seems to come from messages that are created by the unmanaged C++ library and passed into our managed code. When our managed code finishes with them they do not seem to get cleaned up.<o:p></o:p></SPAN></FONT></DIV> <DIV><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><o:p> </o:p></SPAN></FONT></DIV> <DIV><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Please help.<o:p></o:p></SPAN></FONT></DIV> <DIV><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><o:p> </o:p></SPAN></FONT></DIV> <DIV><STRONG><B><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Sam Smith</SPAN></FONT></B></STRONG><o:p></o:p></DIV> <DIV><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Developer / Infrastructure</SPAN></FONT><o:p></o:p></DIV> <DIV><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Intelligent Financial Systems</SPAN></FONT><o:p></o:p></DIV> <DIV><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">110 <st1:place w:st="on">St Martin</st1:place>'s Lane<BR><st1:City w:st="on"><st1:place w:st="on">London</st1:place></st1:City><BR>WC2N 4BA</SPAN></FONT><o:p></o:p></DIV> <DIV><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt"> <o:p></o:p></SPAN></FONT></DIV> <DIV><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Telephone 020 7379 7328</SPAN></FONT><o:p></o:p></DIV> <DIV><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Fax 020 7379 7329</SPAN></FONT><o:p></o:p></DIV> <DIV><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt"><o:p> </o:p></SPAN></FONT></DIV></DIV> <HR> -------------------------------------------------------------------------<BR>This <A href="http://sf.net/" target=_blank moz-do-not-send="true"><a href="http://SF.net">SF.net</a></A> email is sponsored by: Microsoft<BR>Defy all challenges. Microsoft(R) Visual Studio 2008.<BR><A href="http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/" target=_blank moz-do-not-send="true"><a href="http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/">http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/</a></A> <HR> _______________________________________________<BR>Quickfix-users mailing list<BR><A href="#Compose" target=_self moz-do-not-send="true" _onclick="Popup.composeWindow('pcompose.php?sendto=Quickfix-users%40lists.sourceforge.net'); return false;"><a href="mailto:Qui...@li...">Qui...@li...</a></A><BR><A href="https://lists.sourceforge.net/lists/listinfo/quickfix-users" target=_blank moz-do-not-send="true"><a href="https://lists.sourceforge.net/lists/listinfo/quickfix-users">https://lists.sourceforge.net/lists/listinfo/quickfix-users</a></A><BR></BLOCKQUOTE><PRE wrap=""><HR width="90%" SIZE=4> ------------------------------------------------------------------------- This <a href="http://SF.net">SF.net</a> email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. <A class=moz-txt-link-freetext href="http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/" target=_blank><a href="http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/">http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/</a></A></PRE><PRE wrap=""><HR width="90%" SIZE=4> _______________________________________________ Quickfix-users mailing list <A class=moz-txt-link-abbreviated onclick="Popup.composeWindow('pcompose.php?sendto=Quickfix-users%40lists.sourceforge.net');; return false;" href="mailto:Qui...@li..." target=_blank><a href="mailto:Qui...@li...">Qui...@li...</a></A> <A class=moz-txt-link-freetext href="https://lists.sourceforge.net/lists/listinfo/quickfix-users" target=_blank><a href="https://lists.sourceforge.net/lists/listinfo/quickfix-users">https://lists.sourceforge.net/lists/listinfo/quickfix-users</a></A> </PRE></BLOCKQUOTE><BR><PRE class=moz-signature cols="72"> </PRE> <HR> -------------------------------------------------------------------------<BR>Check out the new <a href="http://SourceForge.net">SourceForge.net</a> Marketplace.<BR>It's the best place to buy or sell services for<BR>just about anything Open Source.<BR><A href="http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace" target=_blank><a href="http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace">http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace</a></A> <HR> _______________________________________________<BR>Quickfix-users mailing list<BR><A onclick="Popup.composeWindow('pcompose.php?sendto=Quickfix-users%40lists.sourceforge.net'); return false;" href="#Compose">Quickfix-users<B></B>@lists.sourceforge.net</A><BR><A href="https://lists.sourceforge.net/lists/listinfo/quickfix-users" target=_blank><a href="https://lists.sourceforge.net/lists/listinfo/quickfix-users">https://lists.sourceforge.net/lists/listinfo/quickfix-users</a></A><BR></BLOCKQUOTE></body></html> |