<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Debugging Native memory leaks with Debug Diag 1.1</title><link>http://blogs.msdn.com/b/tess/archive/2010/01/14/debugging-native-memory-leaks-with-debug-diag-1-1.aspx</link><description>I often get questions about debugging native memory leaks. In other words, cases where you have high memory usage in your application but you can see that .net memory usage is not all that high. Recently I was helping out on such a case and this post</description><dc:language>sv-SE</dc:language><generator>Telligent Evolution Platform Developer Build (Build: 5.6.50428.7875)</generator><item><title>re: Debugging Native memory leaks with Debug Diag 1.1</title><link>http://blogs.msdn.com/b/tess/archive/2010/01/14/debugging-native-memory-leaks-with-debug-diag-1-1.aspx#10415667</link><pubDate>Thu, 02 May 2013 15:18:25 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10415667</guid><dc:creator>cdel</dc:creator><description>&lt;p&gt;Hi Tess:&lt;/p&gt;
&lt;p&gt;I ran DebugDiag against an application and it found a leak... but I&amp;#39;m looking at the committed bytes in the heap dump. Most of the memory belongs to the heap used by leakdiag.... is the heap used by leakdiag mixed up with the application&amp;#39;s heap? Is the heap used by Leakdiag ignored when calcuating the total allocation bytes to the Memory leak calculation loss? &lt;/p&gt;
&lt;p&gt;Thanks a bunch.&lt;/p&gt;
&lt;p&gt;C.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10415667" width="1" height="1"&gt;</description></item><item><title>re: Debugging Native memory leaks with Debug Diag 1.1</title><link>http://blogs.msdn.com/b/tess/archive/2010/01/14/debugging-native-memory-leaks-with-debug-diag-1-1.aspx#10177841</link><pubDate>Wed, 22 Jun 2011 15:33:33 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10177841</guid><dc:creator>Nilesh</dc:creator><description>&lt;p&gt;Tess - All you bogs on troubleshooting memory and performance issues are quite informative, thansk for that. However I have issue, for which am unable to conclude how to proceed, appreciate your help here. &lt;/p&gt;
&lt;p&gt;summary of the issues&lt;/p&gt;
&lt;p&gt;- w3wp private bytes keeps increasing, about 20MB for 500 transaction each&lt;/p&gt;
&lt;p&gt;- w3wp &amp;#39;#Byte in heap looks stable&lt;/p&gt;
&lt;p&gt;# These concludes that leak is in unmanaged code and not in managed code, right?&lt;/p&gt;
&lt;p&gt;Next I used Debug Diag as you have suggested in one of your post to investigate issues related to Native memory. Debug Diag reports that issues is with memory fragmentation in Default Process Heap - not sure what it means.&lt;/p&gt;
&lt;p&gt;==========================&lt;/p&gt;
&lt;p&gt;Detected symptoms of high fragmentation in the following heaps in w3wp.exe__StressTest2__PID__2388__Date__05_12_2011__Time_01_14_25PM__164__Manual Dump.dmp&lt;/p&gt;
&lt;p&gt;0x00090000 (Default process heap - 99.52% Fragmented)&lt;/p&gt;
&lt;p&gt;Heap 1 - 0x00090000 &lt;/p&gt;
&lt;p&gt;Heap Name &amp;nbsp; Default process heap &lt;/p&gt;
&lt;p&gt;Heap Description &amp;nbsp; This heap is created by default and shared by all modules in the process &lt;/p&gt;
&lt;p&gt;Reserved memory &amp;nbsp; 1,006.42 MBytes &lt;/p&gt;
&lt;p&gt;Committed memory &amp;nbsp; 78.48 MBytes (7.80% of reserved) &amp;nbsp;&lt;/p&gt;
&lt;p&gt;Uncommitted memory &amp;nbsp; 927.94 MBytes (92.20% of reserved) &amp;nbsp;&lt;/p&gt;
&lt;p&gt;Number of heap segments &amp;nbsp; 64 segments &lt;/p&gt;
&lt;p&gt;Number of uncommitted ranges &amp;nbsp; 2884 range(s) &lt;/p&gt;
&lt;p&gt;Size of largest uncommitted range &amp;nbsp; 4.43 MBytes &lt;/p&gt;
&lt;p&gt;Calculated heap fragmentation &amp;nbsp; 99.52% &lt;/p&gt;
&lt;p&gt;===========================&lt;/p&gt;
&lt;p&gt;Any idea how to proceed further on investigation? &lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;
&lt;p&gt;-nilesh&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10177841" width="1" height="1"&gt;</description></item><item><title>re: Debugging Native memory leaks with Debug Diag 1.1</title><link>http://blogs.msdn.com/b/tess/archive/2010/01/14/debugging-native-memory-leaks-with-debug-diag-1-1.aspx#10102571</link><pubDate>Thu, 09 Dec 2010 11:16:20 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10102571</guid><dc:creator>Karuna</dc:creator><description>&lt;p&gt;Hi Tess,&lt;/p&gt;
&lt;p&gt;We are having memory issues with our web application. Pvt bytes of w3wp is 1.09GB, Virtual Mem is ~900MB and #Bytes in all heaps is ~750MB. So where is my memory going - is it native leak or managed memory leak? Can I debug native memory leaks with WinDbg?&lt;/p&gt;
&lt;p&gt;Thanks.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10102571" width="1" height="1"&gt;</description></item><item><title>re: Debugging Native memory leaks with Debug Diag 1.1</title><link>http://blogs.msdn.com/b/tess/archive/2010/01/14/debugging-native-memory-leaks-with-debug-diag-1-1.aspx#10099729</link><pubDate>Thu, 02 Dec 2010 22:17:23 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10099729</guid><dc:creator>Sean</dc:creator><description>&lt;p&gt;Paul, if DebugDiag is too invasive, you might want to give UMDH a try - &lt;a rel="nofollow" target="_new" href="http://msdn.microsoft.com/en-us/library/ff560206%28VS.85%29.aspx"&gt;msdn.microsoft.com/.../ff560206%28VS.85%29.aspx&lt;/a&gt; &amp;nbsp;It works with my large and complex application, while DebugDiag does not.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10099729" width="1" height="1"&gt;</description></item><item><title>re: Debugging Native memory leaks with Debug Diag 1.1</title><link>http://blogs.msdn.com/b/tess/archive/2010/01/14/debugging-native-memory-leaks-with-debug-diag-1-1.aspx#10099324</link><pubDate>Thu, 02 Dec 2010 02:56:21 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10099324</guid><dc:creator>Karthi</dc:creator><description>&lt;p&gt;Hi I&amp;#39;m Using Windows server 2008 x64 bit. I find that i cannot use DebugDiag. Is there any other way i can troubleshoot my native memory leak?. Any help is really appreciated. Thanks.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10099324" width="1" height="1"&gt;</description></item><item><title>re: Debugging Native memory leaks with Debug Diag 1.1</title><link>http://blogs.msdn.com/b/tess/archive/2010/01/14/debugging-native-memory-leaks-with-debug-diag-1-1.aspx#10088662</link><pubDate>Wed, 10 Nov 2010 08:13:52 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10088662</guid><dc:creator>Tess1</dc:creator><description>&lt;p&gt;HI Paul,&lt;/p&gt;
&lt;p&gt;Debug diag leaktracking can be pretty invasive since it records stacks and detours all allocations. &amp;nbsp;Unfortunately that is the nature of pretty much any such tools because of what it needs to do to track native leaks, and to my knowledge there aren&amp;#39;t a lot other tools like it out there. &amp;nbsp;If possible, can you track only for a shorter time, with the option (under tools/options) to track stacks immediately? &amp;nbsp;If you are not certain if your leak is managed or native i would also suggest looking at that first since managed &amp;quot;leaks&amp;quot; dont require leaktracking to troubleshoot.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10088662" width="1" height="1"&gt;</description></item><item><title>re: Debugging Native memory leaks with Debug Diag 1.1</title><link>http://blogs.msdn.com/b/tess/archive/2010/01/14/debugging-native-memory-leaks-with-debug-diag-1-1.aspx#10088236</link><pubDate>Tue, 09 Nov 2010 16:39:24 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10088236</guid><dc:creator>Paul</dc:creator><description>&lt;p&gt;Hi Tess,&lt;/p&gt;
&lt;p&gt;Does Debug Diag have a large footprint? &amp;nbsp;It seems that as soon as I turn leak tracking on, my application slows to a crawl and eventually hangs before I can get anything useful out of it. &amp;nbsp;(It is a very large and complex application) &amp;nbsp;Are there any other options for me?&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;Paul&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10088236" width="1" height="1"&gt;</description></item><item><title>re: Debugging Native memory leaks with Debug Diag 1.1</title><link>http://blogs.msdn.com/b/tess/archive/2010/01/14/debugging-native-memory-leaks-with-debug-diag-1-1.aspx#10022901</link><pubDate>Thu, 10 Jun 2010 12:33:20 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10022901</guid><dc:creator>Tess</dc:creator><description>&lt;p&gt;Tejas, &lt;/p&gt;
&lt;p&gt;That could be anything from not running debug diag under an appropriate user (someone who has debugging privileges for the process) to a bad install of debug diag or that debug diag and the process dont have the same architecture x64/x86.&lt;/p&gt;
&lt;p&gt;If you cant get it working, try commenting on the &lt;a rel="nofollow" target="_new" href="http://blogs.msdn.com/b/debugdiag/"&gt;blogs.msdn.com/.../debugdiag&lt;/a&gt; blog since they have more knowledge about the tool itself.&lt;/p&gt;
&lt;p&gt;Tess&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10022901" width="1" height="1"&gt;</description></item><item><title>re: Debugging Native memory leaks with Debug Diag 1.1</title><link>http://blogs.msdn.com/b/tess/archive/2010/01/14/debugging-native-memory-leaks-with-debug-diag-1-1.aspx#10022863</link><pubDate>Thu, 10 Jun 2010 09:59:50 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10022863</guid><dc:creator>Tejas</dc:creator><description>&lt;p&gt;I am facing some problem after installing debug diag tool....After selecting a particular process for memory leak we get error....&amp;quot;Error while injecting leaktrack ino process via the dbgsvc service. Getlasterror returns 0x000000057. Could not open process handle to process. Can you please help me in this..&amp;quot;&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10022863" width="1" height="1"&gt;</description></item><item><title>re: Debugging Native memory leaks with Debug Diag 1.1</title><link>http://blogs.msdn.com/b/tess/archive/2010/01/14/debugging-native-memory-leaks-with-debug-diag-1-1.aspx#9971650</link><pubDate>Tue, 02 Mar 2010 17:56:03 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9971650</guid><dc:creator>Robert</dc:creator><description>&lt;p&gt;(Me one last time! Sorry for all the questions and thanks for the responses.)&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9971650" width="1" height="1"&gt;</description></item></channel></rss>