DEBUGGING USING SOS EXAMPLE =========================== Sample Application: Store.exe, containing one or more instances of Item class. 1) Start application. 2) Attach WinDbg. 3) Get information about the Item class: 0:004> !name2ee store.exe Store.Item Module: 00d40c14 (Store.exe) Token: 0x02000002 MethodTable: 00d442dc EEClass: 00db21c4 Name: Store.Item 4) Get information about each instance of Item class: Use MethodTable address from (2), above. 0:004> !dumpheap -mt 00d442dc Address MT Size 013a03b8 00d442dc 20 013b409c 00d442dc 20 013bca10 00d442dc 20 total 3 objects Statistics: MT Count TotalSize Class Name 00d442dc 3 60 Store.Item Total 3 objects 5) Check the root of the first Item object: 0:004> !gcroot 013a03b8 Note: Roots found on stacks may be false positives. Run "!help gcroot" for more info. ebx:Root:01392b60(System.Windows.Forms.Application+ThreadContext)-> 01392214(Store.Form1)-> 01392454(System.Collections.Generic.List`1[[Store.Item, Store]])-> 013d5f2c(System.Object[])-> 013a03b8(Store.Item) Scan Thread 0 OSTHread ee4 Scan Thread 2 OSTHread c48 DOMAIN(001483A8):HANDLE(WeakLn):9f1088:Root:013a074c(System.Windows.Forms.NativeMethod s+WndProc)-> 0139ec94(System.Windows.Forms.Control+ControlNativeWindow)-> 0139ebc4(System.Windows.Forms.CheckBox)-> 0139d6f8(Store.Transaction)-> 013a03b8(Store.Item) 6) List the memory ranges for generations 0, 1, 2 and large object heap: 0:004> !eeheap -gc