ASP.NET Tip: Understanding the caching of data in SOS

The sos that comes with the debugger, in the clr10 directory, has a lot of additional features and speed improvements for .NET 1.x troubleshooting.  One of the main ways it does this is by caching the data that is gathered from !DumpHeap -stat.

This is something important to remember if something happens where the command is run, but then something happens so that the cache isn't fully correct.  For example, if you are opening a dump on a remote share and some network issue happens, the cache will only be a partial cache.  If you try to run any commands that depend on that cache, they will only give partial output since the cache isn't complete.

The only way to resolve this is to unload the debugger extension (SOS) and reload it.  Then the cache will be recreated.

One other point of note along these lines.  If you are debugging a live process, it does not cache the data.  This is because normally you will run a command, let the process run some, and then run it again.  You don't want stale data when you re-run the commands.

One side-note, if you run !DumpHeap -stat a second time against a live process, you will see an additional column of output.  This is showing you the change from the last time the command was run.  This can be helpful to quickly see how much things have changed.

Published 08 October 08 06:00 by Tom
Filed under: , , ,

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

# ASP.NET Tip: Understanding the caching of data in SOS : EasyCoded said on October 8, 2008 6:16 AM:

PingBack from http://www.easycoded.com/aspnet-tip-understanding-the-caching-of-data-in-sos/

# AtulGupta said on February 10, 2009 5:58 AM:

Tom, we get a new version of SOS for .net 1.1 with WinDBG, but what about .net 2.0 and later? The current SOS for .net 1.1 that I got by downloading WinDBG recently has many more commands than the .net 2.0 version has. Is there a way to get a new SOS for .net 2.0 and later?

# Tom said on February 11, 2009 12:04 AM:

I am trying to figure out if there is a way, but as of right now it is now available.  I thought it was going to be, but then things changed on me.  I will let everyone know as soon as I have more information.

Leave a Comment

(required) 
(optional)
(required) 

  
Enter Code Here: Required

Search

This Blog

Syndication

Page view tracker