views:

117

answers:

2

Basically, I have an object that I think should be garbage-collected but it's not. I am pretty certain all references to it are gone from what I can see in the code but for some reason, it is not getting destroyed.

Is there some way to find out what's holding my object hostage? There doesn't seem to be a way to do that in Visual Studio 2005. WinDbg perhaps?

A: 

CLR Profiler for .net 2.0

Please check other versions if you are not on ver 2.0

Also this article helped me on a project a while ago, check it out

http://msdn.microsoft.com/en-us/library/ms404247.aspx

CodeToGlory
That link points to WeakReference article - did you mean to?Also, I tried CLR Profiler but I can't seem to figure out how to use it for my needs...
Jiho Han
+2  A: 

Yes, you can use WinDbg + SOS to trace your managed heap. This link should get you started.

Note - you don't have to use VADump (steps 1 to 3) to get a dump file, the Visual Studio debugger has this feature built in for an attached process.

Not Sure