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.

Comments (3)

  1. AtulGupta says:

    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?

  2. 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.

Skip to main content