Is it possible to list all references of an object, while debugging in Visual Studio. I am using C#. I am looking for something similar to what GC does during garbage collection.
+5
A:
SOS can do this for you. It isn't integrated into the debugger, but you can attach it to your running process. You may find it helpful to use SOSAssist, rather than learning the console syntax. IIRC:
!dumpheap –type {type}
Marc Gravell
2009-04-01 21:44:58
+1. Also, this link helped me get started with SOS for exactly this purpose: http://blogs.msdn.com/ricom/archive/2004/12/10/279612.aspx
Not Sure
2009-04-01 22:00:42
Also see Tess Ferrandez's great debugging blog, e.g. http://blogs.msdn.com/tess/archive/2007/10/19/net-finalizer-memory-leak-debugging-with-sos-dll-in-visual-studio.aspx
Dave
2009-04-01 22:31:44
+1
A:
Here's how I do it:
http://stackoverflow.com/questions/227909/memory-leaks-in-c-wpf/227966#227966
Daniel Earwicker
2009-06-30 17:17:53