views:

17

answers:

1

I am using sos.dll to find memory leak in wpf . And I found a wpf object was not released, then I tried to find out why it is not released by using !gcroot

it gave me a warming that:

Please note that 6c369950 is not a valid object.

snippet of the debugging info

!dumpheap -type WPFUILib.MenuWindow
Statistics:
      MT    Count    TotalSize Class Name
0c12ef4c       14          224 WPFUILib.MenuWindow+<>c__DisplayClass2b
03fdf624        2          816 WPFUILib.MenuWindow
Total 16 objects

!gcroot 03fdf624
Note: Roots found on stacks may be false positives. Run "!help gcroot" for
more info.
Please note that 03fdf624 is not a valid object.
A: 

You're trying to find the roots for a MethodTable (MT), but !gcroot expects an object address. If you want to find the roots for your two instances of WPFUILib.MenuWindow you need to locate their addresses first. Use !dumpheap -mt 03fdf624 to list the addresses and then use !gcroot on those.

Brian Rasmussen