views:

73

answers:

1

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?

+2  A: 

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.

Brian Rasmussen
the application I'm debugging took 1.41 gb memory (plus about the same amount of virtual memory) and I'm trying to figure out why. having 835Mbs allocated for strings didnt seem normal to me, and I'm trying to figure out what all strings are used for.
jgauffin
Ins't min/max just object size and not object index? (i.e. I want to view objects # 100000 to 100100 of all 441762 objects)
jgauffin
@jgauffin: You'll generally see a lot of strings in any .NET application, but 800+ MB of strings seems like too much. Are you building XML/HTML/whatever documents on the fly perhaps?
Brian Rasmussen
Yes, min/max are used to specify size. Did I suggest otherwise somewhere?
Brian Rasmussen
no, you didn't suggest anything else. I was looking for something else, sorry :) The application using a lot of memory is a COM+ application (server application with a lot of ServicedComponents). It's called from a Windows Service and returns datasets (mostly untyped).
jgauffin
Do you have any idea what the strings are at this point? Otherwise I suggest using SOSEX.dll to dig around. Let me know if you have additional questions on this.
Brian Rasmussen
!strings lists all 441 762 strings, not very useful
jgauffin
As I said, you can specify a filter, if you're looking for specific strings. Otherwise use the -min flag to find all strings of a certain size.
Brian Rasmussen
Use !sosex.help strings for a list of options.
Brian Rasmussen