Note that there are some explanatory texts on larger screens.

plurals
  1. POTechniques for finding/avoiding unmanaged leaks in managed code
    primarykey
    data
    text
    <p>What are the best ways for a .NET developer to hunt down (and avoid) <em>unmanaged</em> leaks in a managed app?</p> <p>There seem to be many excellent resources for tracking down managed leaks, but I haven't found much on tracking unmanaged leaks in a managed app.</p> <p><a href="https://stackoverflow.com/questions/45627/how-do-you-detect-avoid-memory-leaks-in-your-unmanaged-code">This question</a> is related, but asks the question from a purely unmanaged point of view, so many of the answers assume that you have access to unmanaged code, and none mention any .NET-specific pitfalls or techniques.</p> <p>Here are some (very basic) things I have tried:</p> <ul> <li><a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=28BD5941-C458-46F1-B24D-F60151D875A3&amp;displaylang=en" rel="nofollow noreferrer">DebugDiag</a>. It looks very promising, and it may work for you, but it happens to crash my particular app.</li> <li><a href="http://www-01.ibm.com/software/awdtools/purifyplus/" rel="nofollow noreferrer">Rational PurifyPlus</a>. Sadly, also crashes my app.</li> <li><a href="http://www.automatedqa.com/products/aqtime/" rel="nofollow noreferrer">AQTime</a> (at the recommendation of @Reed and @Caelum). This program looks fabulous, but, like the poster of the question @Caelum mentioned, AQTime also crashes my app.</li> <li>Temporarily remove code that creates objects that I know use unmanaged memory.</li> <li>Ensure that the app is disposing all objects that implement <code>IDisposable</code></li> </ul> <p>I should mention that I was able to successfully profile another managed app (which was leaking unmanaged memory) using the profilers above. Please give them a try if you've got an unmanaged leak.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload