New Silverlight SOS.DLL Command: !AnalyzeOOM

August 27, 2008

2 comments

In the conclusion of my previous post on the Silverlight SOS.DLL, I’ve mentioned that some new commands (not present in the desktop CLR version) have been added.

The first command we’ll talk about is !AnalyzeOOM, which (as its name implies) analyzes an out of memory condition and explains what went wrong.  There are various reasons for out of memory exceptions, and this command can help you to pinpoint exactly what went wrong.

I’ve written a simple Silverlight application that allocates 1MB byte arrays in a loop and keeps them referenced forever.  After a few seconds the application crashes with an OutOfMemoryException.  Running the command exposes the following:

0:005> !PrintException
Exception object: 03991ad4
Exception type: System.OutOfMemoryException
<snipped for clarity>
0:005> !AnalyzeOOM
Managed OOM occured after GC #17 (Requested to allocate 1048592 bytes)
Reason: Didn’t have enough memory to commit

Observing the process’ virtual address space reveals the following (edited):

0:005> !VMStat
TYPE  MINIMUM MAXIMUM AVERAGE
Free:
Large 1,032K  16,004K 5,898K
<snipped for clarity>

Hmm.  The largest available block of virtual memory is less than 16MB (which is less than the smallest GC segment size).  This is why the allocation is failing.

Add comment
facebook linkedin twitter email

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

*

2 comments

  1. Ilya RyzhenkovAugust 28, 2008 ב 5:00 AM

    Any chance to have these new commands in “normal” sos?

    Reply
  2. CAsmJune 4, 2009 ב 3:05 AM

    The new commands look like they are available in .NET 4.0 (based on beta1 anyway).

    Reply