Showing posts with label SOS. Show all posts
Showing posts with label SOS. Show all posts

Monday, May 6, 2013

Is it leaking?

I wondered if my program was leaking. Here's how I found out:
Using Visual Studio 2012, into the immediate window, I typed:

.load SOS

Then, I investigated my class with this command (still in the immediate window).

!DumpHeap -type

I could see how many objects there were of this type in the heap. I could see their addresses in memory.

!gcroot

This command showed me where they came from and what other objects had references to them.

Finally:

!finalizequeue -allready

This allowed me to verify that although the object wasn't finalized yet, it was due to be whenever the Garbage Collector got around to it and therefore, my program wasn't leaking.

Tuesday, July 17, 2012

How to load SOS into Visual Studio

How to load SOS debugging extensions into the immediate window of Visual Studio (any version).

.load sos

For some reason, this little gem has escaped me until now. Will I ever use WinDBG again? Do I feel sad or glad about that?