Which thread is using a given object?
- I run dumpheap -type MyObjectType command to get the method table for MyObjectType. It shows three object on heap.
- I run dumpheap -mt <method table address> to get address.
- I run !gcroot <address> command to find the references to these objects, find nothing
- !do <address> and it provides details about fields for this object etc.
How can I find which thread is referencing or using object? Any command to find that out?
There's no easy way to do this, but you could run !dso for each thread (i.e. ~*!dso). That will tell you which objects each of the threads reference. To help navigate the output I usually log it to a file and use grep or a decent text editor to search the results.