views:

130

answers:

3

I have a bit of code that passes around a ton of objects and I want to determine if there are any references still lingering around that I am unaware of and where it is those references are located. Any idea of how I can do this?

My understanding is that the watch window only allows me to see items available to the currently executing code block, and the "Find All References" only helps if I add references to objects at compile time. Unless there is more to the watch window than I am aware of.

+1  A: 

In a IDE like Elcipse or Visual Studio you can do it with the context menu.

+2  A: 

if you are talking in the code, just right click on the object name, in the drop down menu pick "Find all references", the list of references will appear below in the output window

EDIT: Since there was only a .NET tag, Visual Studio assumed

curtisk
+1  A: 

A profiler will allow you to do this. CLR Profiler or ANTS Profiler are two examples.

Kent Boogaart