• Answers
  • Web
Personalize Yedda, (And make Danny Happy)
People ask & answer about almost everything. Tell us what you're interested in... So we can personalize Yedda especially for you
I'm interested in:
Originated from
Advanced .NET Debugging

SOS.DLL for .NET 2.0 does not support -gen for !dumpheap

The SOS.DLL that I have for .NET 2.0 and WinDbg 6.6.7.5 does not support the -gen argument for the !dumpheap command.  What is going on here?


tia greenaj


Share Send to a friend Watch Report
 
 

3 Posted Answers
Order by

 
207 helpful answers

They're coming to take me away, Ha-haaa!

Advanced .NET Debugging Blog

My personal blog

Unfortunately I'm unaware of a new version of SOS for .NET 2.0 and the SOS supplied with WinDbg is for .NET 1.1 only.

It seems the -gen parameter of the !dumpheap command was left out when they shipped .NET 2.0.

You can, however, get the same functionality in a different way.

By combining two commands - !eeheap and !dumpheap you can get the same functionality as the -gen parameter in !dumpheap.

!dumpheap can also get a start and end address in which to search. If we can supply it with the memory segments of a specific generation you will get the same functionality. The annoying thing is that if they have more than one segment and they are not following each other you will have to run it for each segment.

First, run "!eeheap -gc". This will list all of the generation's start addresses as well as memory segments that they use. The output will look something like this:

0:014> !eeheap -gc
Number of GC Heaps: 1
generation 0 starts at 0x013f694c
generation 1 starts at 0x013cb21c
generation 2 starts at 0x01391000
ephemeral segment allocation context: (0x01406de8, 0x01408970)
 segment    begin allocated     size
001b2da0 7a721784  7a74248c 0x00020d08(134408)
00197dc8 7b451688  7b467f9c 0x00016914(92436)
001847b0 790d6358  790f5800 0x0001f4a8(128168)
01390000 01391000  01408970 0x00077970(489840)
Large object heap starts at 0x02391000
 segment    begin allocated     size
02390000 02391000  0239a130 0x00009130(37168)
Total Size   0xd7564(882020)
------------------------------
GC Heap Size   0xd7564(882020)

The bold number, for example, shows that generation 2 start at the address of 01391000. At the list of segments below we can see that we have a segment who's address starts at 01391000 and ends at 01408970.

Now we can run the command "!dumpheap 01391000 01408970" and see all the objects in this segments which are, in fact, all generation 2 objects (at least in this sample application).

I do hope that Microsoft will release an updated version of the SOS for .NET 2.0 which will include all of the missing functionality that we had in previous versions of SOS for .NET 1.1 (and hopefully with some new and interesting features as well Smile)

Posted 2006-12-12T08:38:29Z
Eran was invited by Yedda to answer this question.

Helpful?(2)
Rated as Best Answer
 

Thanks, but in the address range 01391000 to 01408970, aren't 013f694c and 013cb21c incluced?  

It seems that "!dumpheap 013f694c" gives me Gen 0, "!dumpheap 013f694c 013cb21c" gives me Gen 1 , and "!dumpheap 01391000 013cb21c" gives me Gen 2.  Given the output from "!eeheap -gc", it seems that Gen 0 has the hightest address, Gen 1 the next highest, and Gen 2 the lowest.

Correct me if I'm wrong but it seems that "!dumpheap  <loweraddress> <higheraddress>" gives me the object allocated in that range of memory.

 I'm trying to make sure that I understand this stuff.

 

Regards,

Aris J. Green 

Posted 2006-12-12T18:30:50Z
 
207 helpful answers

They're coming to take me away, Ha-haaa!

Advanced .NET Debugging Blog

My personal blog

You are correct about the usage of !dumpheap start end showing you objects in the range.

My sample might not be the best one since this was a sample app that didn't allocate much and therefore some segments for some generations did not exist at all.

I'm currently not able to produce a better sample, but when I'll get some time tomorrow I will give you a snapshot of some real data.

According to your response it does seem you got the idea, and !eeheap -gc should provide you with the necessary address ranges per generation (or more accurately per generation memory segment).

 

Posted 2006-12-12T21:29:07Z
Eran was invited by Yedda to answer this question.

Sign in to participate

Got an answer for greenaj? Would you like to comment on the posted answers, or vote for the one which you think is the best?

Sign up for a free account, or sign in (if you're already a member).

Feed - Subscribe to changes to this Q&A Blog
ADVERTISEMENT
  • Answers
  • Web
Copyright © 2006-2009, Yedda Inc. and respective copyright owners · CC License