Search code examples
memory-managementwindbgsos

WinDbg alternative to !dumpheap -type?


I got the following line from !dumpheap -stat

000007fee09d6960   441762    835293368 System.String

I'm interested to find out what the 441 762 strings are used for. Doing a

!dumpheap -type System.String

would list all, or am I mistaken? How can I just analyze some of them?


Solution

  • You can use the !dumpheap -strings to list strings. Unfortunately this doesn't give you the object references. You can use -min/-max with the -type flag to specify a size to limit the output to strings of a certain size.

    SOSEX.dll has a very useful !strings command, that lists both the object reference and the text, so it is easy to locate specific strings. It has built in filtering and supports the min and max length options as well.