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


Would you like to answer or comment?

Sign up for a free account, or sign in (if you're already a member).
  • 4212 views
Share Send to a friend Watch Report
 
 

3 Posted Answers

Order by
 
532 thumbs up

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 3 years ago ( permalink )
In reply to greenaj's question
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 3 years ago ( permalink )
In reply to Eran's answer



 
532 thumbs up

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 3 years ago ( permalink )
In reply to greenaj's answer
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).

Explore Related Questions

Other people asked questions on similar topics, check out the answers they received:


WinDbg and C# Applications

What is WinDbg and can I use it to debug applications written in C#?
Submitted by kazabubu 3 years ago
  • viewed 2960 times

Last answer posted 3 years ago by hmemcpy


Debugging c# without Visual-Studio installed?

How do I debug .NET application when Visual-Studio is not installed? Is there an independant debugging utility for C#, as WinDBG ...
Submitted by Paz 1 year ago
  • viewed 2280 times

Last answer posted 1 year ago by Eran


Writing Debugging Extensions

In a blog posted in 2005 you mentioned about writing a prototype which can help write debugging extns in C#. Any pointers in that ...
Submitted by sachinmundra 2 years ago
  • viewed 623 times

Last answer posted 2 years ago by Eran



» More...

Explore Related Posts in Forums

debugging hang process with windbg

Hi All, I am trying to debug my hang process got below stacktrace (builded executable... Hello Niku, Do you debug with Visual Studio Debugger? or other tools, for example, ADPlus...

How to use WinDbg to analyze the crash dump for VC++ application.

Hi Any one knows how to use the windbg for analyzeing dump file. Please share the info... to analyze crash dump using windbg. Thanks, Haranadh

Can I run a .NET garbage collection from WinDbg?

From WinDbg, so that I can focus on the actual memory allocation? Debugging support for MSFT, and I've never needed anything like that to troubleshoot...
» More...
Powered by
Feed - Subscribe to changes to this Q&A Blog
ADVERTISEMENT
Copyright © 2006-2009, Yedda Inc. and respective copyright owners · CC License