Instance has been disposed! However still Referenced By...

Use this forum for questions on how to use .NET Memory Profiler and how to analyse memory usage.
Post Reply
handel_mike
Posts: 1
Joined: Mon Mar 20, 2006 6:50 pm

Instance has been disposed! However still Referenced By...

Post by handel_mike » Mon Mar 20, 2006 6:59 pm

We have an application that shows that a previous instance has been disposed, however it is still referenced by something. What does this mean?

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

Post by Andreas Suurkuusk » Mon Mar 20, 2006 10:27 pm

If the instance is still included in a snapshot, then it has not been garbage collected by the runtime. Since it has not been garbage collected, it must somehow be referenced by a root, and hence it is referenced by at least one other instance or root (which you will see in the "Referenced by" list).

The fact that the instance has been disposed usually indicates that the instance should no longer be used and that it should be elibible for garbage collection. It is, however, possible that you have disposed instances that should not be GCed, e.g. instances that are returned to a pool after being disposed.
Best regards,

Andreas Suurkuusk
SciTech Software AB

Post Reply

Who is online

Users browsing this forum: No registered users and 12 guests