Undisposed instances

Use this forum for questions on how to use .NET Memory Profiler and how to analyse memory usage.
Post Reply
Posts: 3
Joined: Thu May 28, 2009 10:42 am

Undisposed instances

Post by Risotto » Wed Jun 03, 2009 1:42 pm


Something is not clear for me in the result of the profiling of my application. My application is a C#-dll which is hosted by a vendor application (Teststand from NationalIntruments). The application run for several days and the RAM is increasing slowly but continiously.

I used .NET Memory Profiler to search for memory leaks and found the following:
- the number of live instances is constant
- the live memory is increasing
- the number of undisposed instance is increasing

Is there a filter which would allow me to see for which classes the live memory is increasing?

May causes the increasing number of undisposed instances a part of the memory leak? What is the signification of these undisposed instances if the corresponding live instance is constant?

Thanks for any answer,

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

Post by Andreas Suurkuusk » Thu Jun 04, 2009 7:09 pm

If the number of live instances is constant and the live bytes is increasing. then I assume that you have array instances that is replaced by larger arrays over time (e.g. an expanding List<>).

If you collect a snapshot, you should be able to see the classes that have increased their memory usage. You can for instance sort on the "Delta - Live instance sizes" column. Once you have found a class whose memory usage increases, you can get additional information by double-clicking the class to see the Type details.

The number of undisposed instances is an accumulative value, as long as there are new undisposed instances this number will continue to grow, it will never decrease. Undisposed instances do not indicate a memory leak, but having undisposed instances may cause bad memory and resource utilization (e.g. by delaying the release of a resource and causing finalization of instances).
Best regards,

Andreas Suurkuusk
SciTech Software AB

Post Reply

Who is online

Users browsing this forum: No registered users and 8 guests