Finding Leaks based on namespace or assemblies

Use this forum for questions on how to use .NET Memory Profiler and how to analyse memory usage.
Post Reply
Posts: 2
Joined: Tue Jul 26, 2011 6:16 am

Finding Leaks based on namespace or assemblies

Post by idris » Fri Jun 01, 2012 5:33 am

Is it possible to find the leaks from some namespaces and do not consider other namespaces/assmeblies?
The idea behind this is when i run the test cases (using MS Test) i want to find the leak only from my application and not from my test framework. For e.g. if the MemoryStream is allocated by my application and not disposed then profiler should show this causes leak. If the MemoryStream is created by test framework then it should not show this as leak (I am not interested in leak of test framework). Is this anyway to achieve this using the API?
I am using V3.5 profiler.

- Idris

Andreas Suurkuusk
Posts: 1030
Joined: Wed Mar 02, 2005 7:53 pm

Re: Finding Leaks based on namespace or assemblies

Post by Andreas Suurkuusk » Mon Jun 04, 2012 9:10 am

The .NET Memory Profiler API can only be used to detect potential memory leaks based on the Type of instances. It cannot (currently) filter on the allocation call stack.

Additionally, it is not possible to assert on undisposed instances (e.g. MemoryStreams) using the API. The API can only be used to detect whether instances have been GCed as expected. Including additional assertions, such as "NoUndisposedInstances" is probably a good idea and something we will consider for a future version.

However, you can avoid presenting information about undisposed instances created by the testing framework by ignoring the issues based on the allocation call stack or allocation method. Just click in the "Ignore" link in the issue and then ignore the issued by allocation (see screenshot).
Ignore analysis issue
Best regards,

Andreas Suurkuusk
SciTech Software AB

Post Reply

Who is online

Users browsing this forum: No registered users and 28 guests