<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Speaking of which... : SessionState</title><link>http://blogs.msdn.com/johan/archive/tags/SessionState/default.aspx</link><description>Tags: SessionState</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>Aspnet_state.exe crashing on Xp</title><link>http://blogs.msdn.com/johan/archive/2007/12/21/aspnet-state-exe-crashing-on-xp.aspx</link><pubDate>Fri, 21 Dec 2007 18:35:07 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:6828257</guid><dc:creator>JohanS</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/johan/comments/6828257.aspx</comments><wfw:commentRss>http://blogs.msdn.com/johan/commentrss.aspx?PostID=6828257</wfw:commentRss><description>&lt;p&gt;I ran across an interesting situation with a customer today.&lt;/p&gt; &lt;p&gt;He had a workstation running Windows Xp Professional. He'd&amp;nbsp;previously been running Framework 1.1 and had been using the ASP.NET State Service. He had now upgraded to framework 2.0. and upon shutdown he now received the following error:&lt;/p&gt; &lt;p&gt;aspnet_state.exe. Application Error. The instruction at "&lt;a&gt;0x6a2a2fec&lt;/a&gt;" referenced memory at "0x0000000c". The memory could not be "read".&lt;/p&gt; &lt;p&gt;To make a long story short it turned out this was due to an access violation upon shutdown. We did the following and resolved the situation:&lt;/p&gt; &lt;ul&gt; &lt;li&gt;Start Regedit.&lt;/li&gt; &lt;li&gt;Navigate to the HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\ASP.NET_2.0.50727 key.&lt;/li&gt; &lt;li&gt;Right-click "Names" and select Permissions on the context menu.&lt;/li&gt; &lt;li&gt;Click Add and enter NETWORK SERVICE, click "Check Names" and click Ok.&lt;/li&gt; &lt;li&gt;With NETWORK SERVICE highlighted in the "Groups or User Names" list click "Advanced".&lt;/li&gt; &lt;li&gt;On the "Advanced Security Settings for Names" dialogue highlight NETWORK SERVICE and click "Edit".&lt;/li&gt; &lt;li&gt;In the "Permission entry for Names" dialogue check the "Name" box is showing "NETWORK SERVICE" and put check marks against "Query Value", "Set Value", "Create Subkey", "Enumerate Subkeys", "Notify" and "Read Control".&lt;/li&gt; &lt;li&gt;Click Ok on all the dialogues and close Regedit.&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;As I assisted him it turned out my customer had searched the web for a solution and had found quite a few people experiencing the same problem. I guess most of you are working with Windows 2003 / Vista, so this information might be a bit obsolete. But I thought I should share the knowledge anyway.&lt;/p&gt; &lt;p&gt;Happy Holidays! / Johan&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=6828257" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/johan/archive/tags/SessionState/default.aspx">SessionState</category><category domain="http://blogs.msdn.com/johan/archive/tags/Bugs/default.aspx">Bugs</category><category domain="http://blogs.msdn.com/johan/archive/tags/ASP.NET/default.aspx">ASP.NET</category></item><item><title>Getting started with windbg - part II</title><link>http://blogs.msdn.com/johan/archive/2007/11/26/getting-started-with-windbg-part-ii.aspx</link><pubDate>Mon, 26 Nov 2007 16:49:50 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:6531187</guid><dc:creator>JohanS</dc:creator><slash:comments>12</slash:comments><comments>http://blogs.msdn.com/johan/comments/6531187.aspx</comments><wfw:commentRss>http://blogs.msdn.com/johan/commentrss.aspx?PostID=6531187</wfw:commentRss><description>&lt;p&gt;This is a continuation of my previous post with the imaginative name &lt;a href="http://blogs.msdn.com/johan/archive/2007/11/13/getting-started-with-windbg-part-i.aspx"&gt;Getting started with windbg - part I&lt;/a&gt;. I'll be assuming that you've read it, so if you haven't I suggest you check it out first. We're still working with the same sample dump, so I'll pretty much pick up right where we left off.&lt;/p&gt; &lt;h1&gt;More useful commands&lt;/h1&gt; &lt;p&gt;Last time we used some nice commands from the sos-extension to look at the running callstacks, the requests, the CPU load of the threads, etc. We also dug deeper into the callstack to see what distinguished name we used for a SearchRequest. We'll keep using these commands, but also learn a few new ones.&lt;/p&gt; &lt;h2&gt;!dumpstackobjects (!dso)&lt;/h2&gt; &lt;p&gt;Now, imagine that we're looking at a specific thread and would like to see all managed objects referenced to by the current stack. Is there a way for us to do this? - There most certainly is. It's called dumpstackobjects, or dso for short. If we run it on the current thread we'll see a listing of objects that are referenced by the callstack. The whole output would look something like this (trimmed down to size):&lt;/p&gt; &lt;div class="DebugSample"&gt;0:050&amp;gt; !dso&lt;br&gt;OS Thread Id: 0x1e8c (50)&lt;br&gt;ESP/REG&amp;nbsp; Object&amp;nbsp;&amp;nbsp; Name&lt;br&gt;17a9e534 0741f860 System.RuntimeType&lt;br&gt;17a9e6b8 271fdfe0 System.DirectoryServices.Protocols.LdapConnection&lt;br&gt;17a9e6bc 27246f20 System.DirectoryServices.Protocols.SEC_WINNT_AUTH_IDENTITY_EX&lt;br&gt;17a9e740 271fdfe0 System.DirectoryServices.Protocols.LdapConnection&lt;br&gt;17a9e744 27246f20 System.DirectoryServices.Protocols.SEC_WINNT_AUTH_IDENTITY_EX&lt;br&gt;17a9e764 27246f20 System.DirectoryServices.Protocols.SEC_WINNT_AUTH_IDENTITY_EX&lt;br&gt;17a9e768 271fdfe0 System.DirectoryServices.Protocols.LdapConnection&lt;br&gt;17a9e780 271fdfe0 System.DirectoryServices.Protocols.LdapConnection&lt;br&gt;17a9e784 27246e38 System.DirectoryServices.Protocols.SearchRequest&lt;br&gt;17a9e794 271fdf14 System.DirectoryServices.Protocols.LdapDirectoryIdentifier&lt;br&gt;17a9e7a8 27246ef8 System.Collections.ArrayList&lt;br&gt;17a9e7bc 27246ef8 System.Collections.ArrayList&lt;br&gt;17a9e7c8 271fdfe0 System.DirectoryServices.Protocols.LdapConnection&lt;br&gt;17a9e8a4 27246e38 System.DirectoryServices.Protocols.SearchRequest&lt;br&gt;17a9e8d0 27246ed8 System.Object[]&amp;nbsp;&amp;nbsp;&amp;nbsp; (System.Object[])&lt;br&gt;17a9e8e0 073ff6b8 System.String&amp;nbsp;&amp;nbsp;&amp;nbsp; cn&lt;br&gt;17a9e8e4 271fdfe0 System.DirectoryServices.Protocols.LdapConnection&lt;br&gt;17a9e8f4 27246d00 System.String&amp;nbsp;&amp;nbsp;&amp;nbsp; CN=Dummy,CN=Accounts,CN=useradm,DC=Dummy,DC=net&lt;br&gt;17a9e8f8 271fdfe0 System.DirectoryServices.Protocols.LdapConnection&lt;br&gt;17a9e8fc 27246e38 System.DirectoryServices.Protocols.SearchRequest&lt;br&gt;17a9e910 03380310 System.String&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br&gt;17a9e914 27246e24 System.Object[]&amp;nbsp;&amp;nbsp;&amp;nbsp; (System.String[])&lt;br&gt;17a9e918 272399a8 System.String&amp;nbsp;&amp;nbsp;&amp;nbsp; CN=OID-Dummy-ABC123,CN=Dummy,CN=Accounts,CN=useradm,DC=Dummy,DC=net&lt;br&gt;17a9e91c 27246ddc System.String&amp;nbsp;&amp;nbsp;&amp;nbsp; (CN=OID-Dummy-ABC123)&lt;br&gt;...etc...&lt;/div&gt; &lt;p&gt;This is extremely useful when we want to see all the objects referenced by this thread alone. If you want to analyze one of the objects, simply copy the the address from the Object-column and use !dumpobject:&lt;/p&gt; &lt;div class="DebugSample"&gt;0:050&amp;gt; !do 271fdfe0 &lt;br&gt;Name: System.DirectoryServices.Protocols.LdapConnection&lt;br&gt;MethodTable: 14a2040c&lt;br&gt;EEClass: 149daf08&lt;br&gt;Size: 56(0x38) bytes&lt;br&gt;(C:\WINDOWS\assembly\GAC_MSIL\System.DirectoryServices.Protocols\2.0.0.0__b03f5f7f11d50a3a\System.DirectoryServices.Protocols.dll)&lt;br&gt;Fields:&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MT&amp;nbsp;&amp;nbsp;&amp;nbsp; Field&amp;nbsp;&amp;nbsp; Offset&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Type VT&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Attr&amp;nbsp;&amp;nbsp;&amp;nbsp; Value Name&lt;br&gt;14a2078c&amp;nbsp; 40000c3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 4 ...NetworkCredential&amp;nbsp; 0 instance 00000000 directoryCredential&lt;br&gt;14a2144c&amp;nbsp; 40000c4&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 8 ...ificateCollection&amp;nbsp; 0 instance 271fe018 certificatesCollection&lt;br&gt;1202af88&amp;nbsp; 40000c5&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 10&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.TimeSpan&amp;nbsp; 1 instance 271fdff0 connectionTimeOut&lt;br&gt;1466fe50&amp;nbsp; 40000c6&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; c ...rectoryIdentifier&amp;nbsp; 0 instance 271fdf14 directoryIdentifier&lt;br&gt;14a2034c&amp;nbsp; 4000236&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 24&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.Int32&amp;nbsp; 0 instance&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2 connectionAuthType&lt;br&gt;14a223a4&amp;nbsp; 4000237&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 18 ...dapSessionOptions&amp;nbsp; 0 instance 271fe2d8 options&lt;br&gt;0fb896d8&amp;nbsp; 4000238&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 28&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.IntPtr&amp;nbsp; 0 instance 564180944 ldapHandle&lt;br&gt;120261c8&amp;nbsp; 4000239&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2c&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.Boolean&amp;nbsp; 0 instance&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0 disposed&lt;br&gt;120261c8&amp;nbsp; 400023a&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2d&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.Boolean&amp;nbsp; 0 instance&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0 bounded&lt;br&gt;120261c8&amp;nbsp; 400023b&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2e&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.Boolean&amp;nbsp; 0 instance&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0 needRebind&lt;br&gt;14a22084&amp;nbsp; 400023e&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1c ...pResponseCallback&amp;nbsp; 0 instance 271fe03c fd&lt;br&gt;120261c8&amp;nbsp; 4000243&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2f&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.Boolean&amp;nbsp; 0 instance&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0 setFQDNDone&lt;br&gt;120261c8&amp;nbsp; 4000244&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 30&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.Boolean&amp;nbsp; 0 instance&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1 automaticBind&lt;br&gt;120261c8&amp;nbsp; 4000245&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 31&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.Boolean&amp;nbsp; 0 instance&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1 needDispose&lt;br&gt;120261c8&amp;nbsp; 4000246&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 32&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.Boolean&amp;nbsp; 0 instance&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1 connected&lt;br&gt;14a2267c&amp;nbsp; 4000247&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 20 ...s.QUERYCLIENTCERT&amp;nbsp; 0 instance 271fe394 clientCertificateRoutine&lt;br&gt;0fd314bc&amp;nbsp; 400023c&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 20 ...ections.Hashtable&amp;nbsp; 0&amp;nbsp;&amp;nbsp; shared&amp;nbsp;&amp;nbsp; static handleTable&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;gt;&amp;gt; Domain:Value&amp;nbsp; 0019daf0:NotInit&amp;nbsp; 11b42540:073fe504 &amp;lt;&amp;lt;&lt;br&gt;02c36ca0&amp;nbsp; 400023d&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 24&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.Object&amp;nbsp; 0&amp;nbsp;&amp;nbsp; shared&amp;nbsp;&amp;nbsp; static objectLock&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;gt;&amp;gt; Domain:Value&amp;nbsp; 0019daf0:NotInit&amp;nbsp; 11b42540:073fe53c &amp;lt;&amp;lt;&lt;br&gt;0fd314bc&amp;nbsp; 400023f&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 28 ...ections.Hashtable&amp;nbsp; 0&amp;nbsp;&amp;nbsp; shared&amp;nbsp;&amp;nbsp; static asyncResultTable&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;gt;&amp;gt; Domain:Value&amp;nbsp; 0019daf0:NotInit&amp;nbsp; 11b42540:073fe610 &amp;lt;&amp;lt;&lt;br&gt;14a21864&amp;nbsp; 4000240&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2c ...lResultsProcessor&amp;nbsp; 0&amp;nbsp;&amp;nbsp; shared&amp;nbsp;&amp;nbsp; static partialResultsProcessor&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;gt;&amp;gt; Domain:Value&amp;nbsp; 0019daf0:NotInit&amp;nbsp; 11b42540:073fe678 &amp;lt;&amp;lt;&lt;br&gt;12305e94&amp;nbsp; 4000241&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 30 ....ManualResetEvent&amp;nbsp; 0&amp;nbsp;&amp;nbsp; shared&amp;nbsp;&amp;nbsp; static waitHandle&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;gt;&amp;gt; Domain:Value&amp;nbsp; 0019daf0:NotInit&amp;nbsp; 11b42540:073fe64c &amp;lt;&amp;lt;&lt;br&gt;14a21954&amp;nbsp; 4000242&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 34 ...lResultsRetriever&amp;nbsp; 0&amp;nbsp;&amp;nbsp; shared&amp;nbsp;&amp;nbsp; static retriever&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;gt;&amp;gt; Domain:Value&amp;nbsp; 0019daf0:NotInit&amp;nbsp; 11b42540:073fe6a8 &amp;lt;&amp;lt;&lt;/div&gt; &lt;h2&gt;&amp;nbsp;&lt;/h2&gt; &lt;h2&gt;!dumparray (!da)&lt;/h2&gt; &lt;p&gt;As you might have noticed we have a couple of&amp;nbsp;object arrays on the stack.&amp;nbsp;Look for the System.Object[]-type in the listing above and you'll find them. If you execute !dumpobject on an array you'll only get information about the array itself, not it's contents. To get information about what's in the array we need to use the !dumparray-command, or !da for short.&lt;/p&gt; &lt;div class="DebugSample"&gt;0:050&amp;gt; !do 27239b98 &lt;br&gt;Name: System.Object[]&lt;br&gt;MethodTable: 02c3896c&lt;br&gt;EEClass: 02c388ec&lt;br&gt;Size: 24(0x18) bytes&lt;br&gt;Array: Rank 1, Number of elements 2, Type CLASS&lt;br&gt;Element Type: System.String&lt;br&gt;Fields:&lt;br&gt;None&lt;br&gt;&lt;br&gt;0:050&amp;gt; !da 27239b98 &lt;br&gt;Name: System.String[]&lt;br&gt;MethodTable: 02c3896c&lt;br&gt;EEClass: 02c388ec&lt;br&gt;Size: 24(0x18) bytes&lt;br&gt;Array: Rank 1, Number of elements 2, Type CLASS&lt;br&gt;Element Methodtable: 02c39310&lt;br&gt;[0] 272399a8&lt;br&gt;[1] 27239a44&lt;/div&gt; &lt;p&gt;As you can see the !dumparray-command gives us a bit more information about the object. We can see that it contains System.String data and we get the addresses of the two items in the array.&amp;nbsp;Since they're System.String-objects we can simply&amp;nbsp;use !dumpobject to view their contents.&lt;/p&gt; &lt;h2&gt;!objsize&lt;/h2&gt; &lt;p&gt;If you look at the listing above you'll see that the size of the object is listed as 24 bytes. To paraphrase Obi Wan Kenobi: "This is true, from a certain point of view." The 24 bytes are the size of the System.Object[]-object itself. Not it's contents. As you can see when we execute !dumparray, the array only contains two references to two strings. These strings are individual objects and could be 32 MB for all we know, so the 24 bytes are not the &lt;em&gt;total &lt;/em&gt;size of the array, but it would still be correct to claim that the System.Object[] is only 24 bytes large.&lt;/p&gt; &lt;p&gt;To get the &lt;em&gt;total&lt;/em&gt; size of the object we use the !objsize command:&lt;/p&gt; &lt;div class="DebugSample"&gt;0:050&amp;gt; !objsize 27239b98 &lt;br&gt;sizeof(27239b98) =&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 348 (&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x15c) bytes (System.Object[])&lt;/div&gt; &lt;p&gt;!objsize will iterate through all the child objects referenced by the&amp;nbsp;object, as well as all the grandchildren and so on. Apparently the total size of the array and it's child objects is 348 bytes.&lt;/p&gt; &lt;p&gt;If there are a lot of child objects it may take some time for !objsize to calculate the total size of the object. You should also be aware that !objsize may not always be as smart as you'd like. If, for example, you have a custom button control that references it's parent aspx-page you'd get the total size of the aspx-page and all it's child controls. In other words: If !objsize claims that the object in question is ridiculously large you might want to manually check what the object references using !dumpobject.&lt;/p&gt; &lt;h2&gt;!dumpheap&lt;/h2&gt; &lt;p&gt;This is another command that I use frequently. It is, however a command that you will want to use with at least one argument. Dumpheap with no arguments will dump &lt;em&gt;all &lt;/em&gt;objects on the heap, so I usually begin by using the -stat argument, which in itself will write a lot of info on the screen, but it will at least be summarized. Here' you'll find the trimmed down output of !dumpheap -stat:&lt;/p&gt; &lt;div class="DebugSample"&gt;0:050&amp;gt; !dumpheap -stat&lt;br&gt;------------------------------&lt;br&gt;Heap 0&lt;br&gt;total 2754508 objects&lt;br&gt;------------------------------&lt;br&gt;Heap 1&lt;br&gt;total 2761329 objects&lt;br&gt;------------------------------&lt;br&gt;total 5515837 objects&lt;br&gt;Statistics:&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MT&amp;nbsp;&amp;nbsp;&amp;nbsp; Count&amp;nbsp;&amp;nbsp;&amp;nbsp; TotalSize Class Name&lt;br&gt;16e0a6d8&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 12 System.Collections.Generic.ObjectEqualityComparer`1[[System.Data.ProviderBase.DbConnectionInternal, System.Data]]&lt;br&gt;16d9cd9c&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 12 System.Xml.Serialization.Configuration.DateTimeSerializationSection+DateTimeSerializationMode&lt;br&gt;16d9bf30&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 12 System.Diagnostics.OrdinalCaseInsensitiveComparer&lt;br&gt;16d9112c&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 12 System.Xml.Serialization.NameTable&lt;br&gt;16d7f664&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 12 System.Xml.Serialization.TempAssemblyCache&lt;br&gt;163ea85c&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 12 System.Data.Res&lt;br&gt;1501e4c4&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 12 System.Collections.Generic.ObjectEqualityComparer`1[[System.Web.UI.Control, System.Web]]&lt;br&gt;14efb138&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 12 System.Net.TimeoutValidator&lt;br&gt;14ef9964&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 12 System.Net.Cache.HttpRequestCacheLevel&lt;br&gt;14ef77a8&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 12 Microsoft.Win32.WinInetCache&lt;br&gt;14ef68e4&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 12 System.Net.WebRequest+WebProxyWrapper&lt;br&gt;14ef658c&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 12 System.Net.Configuration.ProxyElement+BypassOnLocalValues&lt;br&gt;14ef63d8&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 12 System.Net.Configuration.ProxyElement+AutoDetectValues&lt;br&gt;14ef5b68&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 12 System.Net.CaseInsensitiveAscii&lt;br&gt;14ef5610&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 12 System.Net.HeaderInfoTable&lt;br&gt;14ef4718&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 12 System.Net.HttpRequestCreator&lt;br&gt;14db6710&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 12 System.Web.Configuration.MachineKeyValidationConverter&lt;br&gt;14db3140&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 12 System.Collections.Generic.ObjectEqualityComparer`1[[System.Runtime.Serialization.MemberHolder, mscorlib]]&lt;br&gt;14b3f4d8&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 12 System.Web.UI.SupportsEventValidationAttribute&lt;br&gt;...etc...&lt;br&gt;14a276a8&amp;nbsp;&amp;nbsp;&amp;nbsp; 19578&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 704808 System.DirectoryServices.Interop.AdsValueHelper&lt;br&gt;14a2ea24&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 9196&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 735680 System.Web.UI.WebControls.Label&lt;br&gt;14a2e51c&amp;nbsp;&amp;nbsp;&amp;nbsp; 16862&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 741928 System.Web.UI.WebControls.Style&lt;br&gt;125778ec&amp;nbsp;&amp;nbsp;&amp;nbsp; 48015&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 768240 System.Collections.Specialized.NameObjectCollectionBase+NameObjectEntry&lt;br&gt;120261c8&amp;nbsp;&amp;nbsp;&amp;nbsp; 65842&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 790104 System.Boolean&lt;br&gt;14a2ee7c&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 9198&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 809424 System.Web.UI.WebControls.Table&lt;br&gt;14b311c4&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 9647&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 810348 System.Web.UI.WebControls.Image&lt;br&gt;13a2b7dc&amp;nbsp;&amp;nbsp;&amp;nbsp; 34913&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 837912 System.Web.HttpServerVarsCollectionEntry&lt;br&gt;14b303a4&amp;nbsp;&amp;nbsp;&amp;nbsp; 10605&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 848400 System.Web.UI.WebControls.HyperLink&lt;br&gt;14d8e3d4&amp;nbsp;&amp;nbsp;&amp;nbsp; 77748&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 932976 Microsoft.Web.UI.WebControls.BaseChildNodeCollection+ActionType&lt;br&gt;14db90ac&amp;nbsp;&amp;nbsp;&amp;nbsp; 81372&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 976464 System.Web.UI.WebControls.FontInfo&lt;br&gt;14b30694&amp;nbsp;&amp;nbsp;&amp;nbsp; 28648&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1031328 System.Web.UI.WebControls.TableRow+CellControlCollection&lt;br&gt;14d8fdbc&amp;nbsp;&amp;nbsp;&amp;nbsp; 38912&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1089536 Microsoft.Web.UI.WebControls.TreeNodeCollection&lt;br&gt;14b3d0bc&amp;nbsp;&amp;nbsp;&amp;nbsp; 86592&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1385472 System.Web.UI.Pair&lt;br&gt;1466c5c4&amp;nbsp;&amp;nbsp;&amp;nbsp; 39305&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1414980 System.Web.UI.ControlCollection&lt;br&gt;14d8e48c&amp;nbsp;&amp;nbsp;&amp;nbsp; 77748&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1865952 Microsoft.Web.UI.WebControls.BaseChildNodeCollection+Action&lt;br&gt;1545061c&amp;nbsp;&amp;nbsp;&amp;nbsp; 38874&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2176944 Microsoft.Web.UI.WebControls.TreeNode&lt;br&gt;14b30eec&amp;nbsp;&amp;nbsp;&amp;nbsp; 52668&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2317392 System.Web.UI.WebControls.TableItemStyle&lt;br&gt;14a2f804&amp;nbsp;&amp;nbsp;&amp;nbsp; 28515&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2395260 System.Web.UI.WebControls.TableRow&lt;br&gt;14a2be6c&amp;nbsp;&amp;nbsp;&amp;nbsp; 40894&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2453640 System.Web.UI.LiteralControl&lt;br&gt;0fd3da00&amp;nbsp;&amp;nbsp; 228792&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2745504 System.Int32&lt;br&gt;14b3e3ac&amp;nbsp;&amp;nbsp; 244793&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2937516 System.Web.UI.IndexedString&lt;br&gt;14a2de94&amp;nbsp;&amp;nbsp; 198580&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3177280 System.Web.UI.StateBag&lt;br&gt;1466c454&amp;nbsp;&amp;nbsp;&amp;nbsp; 80512&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3542528 System.Web.UI.Control+OccasionalFields&lt;br&gt;12302c2c&amp;nbsp;&amp;nbsp; 205849&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 4116980 System.Collections.Specialized.HybridDictionary&lt;br&gt;14b30024&amp;nbsp;&amp;nbsp;&amp;nbsp; 52934&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 4446456 System.Web.UI.WebControls.TableCell&lt;br&gt;12302f2c&amp;nbsp;&amp;nbsp; 178294&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 4992232 System.Collections.Specialized.ListDictionary&lt;br&gt;14a2e284&amp;nbsp;&amp;nbsp; 412762&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 6604192 System.Web.UI.StateItem&lt;br&gt;14d8ce64&amp;nbsp;&amp;nbsp; 117078&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 7024680 Microsoft.Web.UI.WebControls.CssCollection&lt;br&gt;0fd314bc&amp;nbsp;&amp;nbsp; 132065&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 7395640 System.Collections.Hashtable&lt;br&gt;1230319c&amp;nbsp;&amp;nbsp; 422580&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 8451600 System.Collections.Specialized.ListDictionary+DictionaryNode&lt;br&gt;1202a58c&amp;nbsp;&amp;nbsp; 380438&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 9130512 System.Collections.ArrayList&lt;br&gt;0fd32050&amp;nbsp;&amp;nbsp; 133000&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 22582944 System.Collections.Hashtable+bucket[]&lt;br&gt;02c3896c&amp;nbsp;&amp;nbsp; 649842&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 23275900 System.Object[]&lt;br&gt;0fd3c12c&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3471&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 36385536 System.Byte[]&lt;br&gt;001fee20&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 338&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 65409920&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Free&lt;br&gt;02c39310&amp;nbsp;&amp;nbsp; 683083&amp;nbsp;&amp;nbsp;&amp;nbsp; 161821000 System.String&lt;br&gt;Total 5515837 objects&lt;br&gt;Fragmented blocks larger than 0.5 MB:&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Addr&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Size&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Followed by&lt;br&gt;2adf31cc&amp;nbsp;&amp;nbsp;&amp;nbsp; 2.0MB&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2aff85d8 System.String&lt;br&gt;2b006a2c&amp;nbsp;&amp;nbsp; 20.3MB&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2c4530d8 System.Net.SocketAddress&lt;/div&gt; &lt;p&gt;As you can see we now get a listing sorted by size of all object-types on the heap. You'll usually find strings down at the bottom since that's what is commonly used the most.&lt;/p&gt; &lt;p&gt;Other useful arguments are -type and -mt (which stands for MethodTable). Using them you're able to see all objects of a specific type. For example. If we want to look at all HttpRequestCreators on the heap (there are one) you'll simply copy it's MethodTable which you'll find in the listing above (14ef4718) and use !dumpheap -mt&lt;/p&gt; &lt;div class="DebugSample"&gt;0:050&amp;gt; !dumpheap -mt 14ef4718&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br&gt;------------------------------&lt;br&gt;Heap 0&lt;br&gt;Address&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MT&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Size&lt;br&gt;0342ccf8 14ef4718&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 12&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br&gt;total 1 objects&lt;br&gt;------------------------------&lt;br&gt;Heap 1&lt;br&gt;Address&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MT&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Size&lt;br&gt;total 0 objects&lt;br&gt;------------------------------&lt;br&gt;total 1 objects&lt;br&gt;Statistics:&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MT&amp;nbsp;&amp;nbsp;&amp;nbsp; Count&amp;nbsp;&amp;nbsp;&amp;nbsp; TotalSize Class Name&lt;br&gt;14ef4718&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 12 System.Net.HttpRequestCreator&lt;/div&gt; &lt;p&gt;This gives us the address of the object and if we'd like to inspect it closer we simply use !dumpobject on that address.&lt;/p&gt; &lt;p&gt;!dumpheap -type works pretty much the same way, except this time you filter the results by class name. !dumpheap -type performs a substring match, so if you write !dumpheap -type System.Web you'll get every object who's class name contains System.Web, which would be a lot.&lt;/p&gt; &lt;p&gt;Other useful arguments are -min and -max which accept a number representing the minimum/maximum number of bytes the object size should be. This can be really useful when troubleshooting string-abuse, etc. Also !dumpheap -stat -min 85000 would list all objects on the large object heap.&lt;/p&gt; &lt;h1&gt;Putting the tools to use&lt;/h1&gt; &lt;p&gt;I'd now like to use the commands we've covered in a bit more practical scenario. The dump we've been looking at is from a previous case of mine. The application in question was running on a Web garden with two workerprocesses. Session State was handled by a SQL Server. The customer was experiencing performance issues and the problem description was hazy at best. Anyway I had tons of dumps to work with, so I simply poked around to see what I could find. One thing I did pretty early on was to look at caching. According to the customer&amp;nbsp;they weren't using the cache at all, but I usually find it best to double-check this type of thing.&lt;/p&gt; &lt;h2&gt;Determining the size of the cache&lt;/h2&gt; &lt;p&gt;To find out how much data was kept in the cache I first needed to find the System.Web.Caching.Cache class.&amp;nbsp;So I ran !dumpheap -stat -type System.Web.Caching.Cache. Note that I also used the -stat argument. Otherwise I would have gotten a very long list of System.Web.Caching.CacheKeys and System.Web.Caching.CacheEntrys as well. Anyway, here's the result:&lt;/p&gt; &lt;div class="DebugSample"&gt;0:050&amp;gt; !dumpheap -type System.Web.Caching.Cache -stat&lt;br&gt;------------------------------&lt;br&gt;Heap 0&lt;br&gt;total 665 objects&lt;br&gt;------------------------------&lt;br&gt;Heap 1&lt;br&gt;total 1084 objects&lt;br&gt;------------------------------&lt;br&gt;total 1749 objects&lt;br&gt;Statistics:&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MT&amp;nbsp;&amp;nbsp;&amp;nbsp; Count&amp;nbsp;&amp;nbsp;&amp;nbsp; TotalSize Class Name&lt;br&gt;123056f8&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 12 System.Web.Caching.CacheKeyComparer&lt;br&gt;&lt;font color="#ff0000"&gt;1230494c&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 12 System.Web.Caching.Cache&lt;br&gt;&lt;/font&gt;1230500c&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 24 System.Web.Caching.CacheMultiple&lt;br&gt;1230514c&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 32 System.Web.Caching.CacheMemoryStats&lt;br&gt;123053b4&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 36 System.Web.Caching.CacheMemoryTotalMemoryPressure&lt;br&gt;123059bc&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 40 System.Web.Caching.CacheUsage&lt;br&gt;12304bdc&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 48 System.Web.Caching.CacheCommon&lt;br&gt;123054f4&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 52 System.Web.Caching.CacheMemoryPrivateBytesPressure&lt;br&gt;12305874&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 64 System.Web.Caching.CacheExpires&lt;br&gt;12304e64&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 200 System.Web.Caching.CacheSingle&lt;br&gt;1255b594&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 85&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1360 System.Web.Caching.CacheDependency+DepFileInfo&lt;br&gt;123046c4&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 40&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1440 System.Web.Caching.CacheDependency&lt;br&gt;123042ec&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 47&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1504 System.Web.Caching.CacheItemRemovedCallback&lt;br&gt;123063fc&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 832&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 16640 System.Web.Caching.CacheKey&lt;br&gt;12306820&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 732&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 52704 System.Web.Caching.CacheEntry&lt;br&gt;Total 1749 objects&lt;/div&gt; &lt;p&gt;Okay, so now I had the MethodTable for the System.Web.Caching.Cache object. Therefore I could now get the address to the object itself. I did this by asking !dumpheap to list all the objects on the heap with that MethodTable. I knew that there was just going to be one hit:&lt;/p&gt; &lt;div class="DebugSample"&gt;0:050&amp;gt; !dumpheap -mt 1230494c&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br&gt;------------------------------&lt;br&gt;Heap 0&lt;br&gt;Address&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MT&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Size&lt;br&gt;&lt;font color="#ff0000"&gt;03392d20&lt;/font&gt; 1230494c&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 12&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br&gt;total 1 objects&lt;br&gt;------------------------------&lt;br&gt;Heap 1&lt;br&gt;Address&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MT&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Size&lt;br&gt;total 0 objects&lt;br&gt;------------------------------&lt;br&gt;total 1 objects&lt;br&gt;Statistics:&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MT&amp;nbsp;&amp;nbsp;&amp;nbsp; Count&amp;nbsp;&amp;nbsp;&amp;nbsp; TotalSize Class Name&lt;br&gt;1230494c&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 12 System.Web.Caching.Cache&lt;br&gt;Total 1 objects&lt;/div&gt; &lt;p&gt;So now I ran !objsize on this object to see how big it was. This took a little time to calculate, since the cache is quite complex and there are a lot of children to iterate through.&lt;/p&gt; &lt;div class="DebugSample"&gt;0:050&amp;gt; !objsize 03392d20 &lt;br&gt;sizeof(03392d20) =&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color="#ff0000"&gt;266640828&lt;/font&gt; (&amp;nbsp;&amp;nbsp; 0xfe49dbc) bytes (System.Web.Caching.Cache)&lt;/div&gt; &lt;p&gt;So the cache is 266 MB in size. That's quite a lot&amp;nbsp;considering the fact that the customer claimed that they weren't using the cache at all!&lt;/p&gt; &lt;h2&gt;What is being cached?&lt;/h2&gt; &lt;p&gt;To sample what the customer was caching I then took a look at a few of the CacheEntrys. I already had the MethodTable for the System.Web.Caching.CacheEntry from when I ran !dumpheap -type System.Web.Caching.Cache -stat (above), so I could use that to retrieve all CacheEntrys.&lt;/p&gt; &lt;div class="DebugSample"&gt;0:050&amp;gt; !dumpheap -mt 12306820&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br&gt;------------------------------&lt;br&gt;Heap 0&lt;br&gt;Address&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MT&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Size&lt;br&gt;033950bc 12306820&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 72&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br&gt;033a20d8 12306820&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 72&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br&gt;033ac79c 12306820&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 72&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br&gt;033da21c 12306820&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 72&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br&gt;033f04c4 12306820&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 72&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br&gt;03428ec8 12306820&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 72&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br&gt;0344dab4 12306820&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 72&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br&gt;03815d00 12306820&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 72&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br&gt;038265d8 12306820&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 72&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br&gt;....etc...&lt;br&gt;03af7010 12306820&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 72&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br&gt;03b291bc 12306820&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 72&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br&gt;03b2c674 12306820&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 72&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br&gt;03b6dca0 12306820&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 72&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br&gt;03b797dc 12306820&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 72&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br&gt;03b85318 12306820&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 72&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br&gt;03ba9150 12306820&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 72&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br&gt;03c258cc 12306820&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 72&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br&gt;03de43c8 12306820&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 72&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br&gt;&lt;font color="#ff0000"&gt;03e160f8&lt;/font&gt; 12306820&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 72&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br&gt;total 382 objects&lt;br&gt;------------------------------&lt;br&gt;total 732 objects&lt;/div&gt; &lt;p&gt;Another valid command that would have given me the exact same output would off course have been !dumpheap -type System.Web.Caching.CacheEntry.&lt;/p&gt; &lt;p&gt;Okay, so now I had a long list of CacheEntrys. To sample the contents I just picked an address and examined it by using !dumpobject&lt;/p&gt; &lt;div class="DebugSample"&gt;0:050&amp;gt; !do 03b2c674 &lt;br&gt;Name: System.Web.Caching.CacheEntry&lt;br&gt;MethodTable: 12306820&lt;br&gt;EEClass: 122f6470&lt;br&gt;Size: 72(0x48) bytes&lt;br&gt;(C:\WINDOWS\assembly\GAC_32\System.Web\2.0.0.0__b03f5f7f11d50a3a\System.Web.dll)&lt;br&gt;Fields:&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MT&amp;nbsp;&amp;nbsp;&amp;nbsp; Field&amp;nbsp;&amp;nbsp; Offset&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Type VT&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Attr&amp;nbsp;&amp;nbsp;&amp;nbsp; Value Name&lt;br&gt;02c39310&amp;nbsp; 4001327&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 4&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.String&amp;nbsp; 0 instance 03b2c600 _key&lt;br&gt;0fb8f1f8&amp;nbsp; 4001328&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; c&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.Byte&amp;nbsp; 0 instance&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2 _bits&lt;br&gt;0fd3da00&amp;nbsp; 4001329&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 8&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.Int32&amp;nbsp; 0 instance -1314181915 _hashCode&lt;br&gt;&lt;font color="#ff0000"&gt;02c36ca0&amp;nbsp; 4001330&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 10&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.Object&amp;nbsp; 0 instance 03b2c644 _value&lt;br&gt;&lt;/font&gt;120219d0&amp;nbsp; 4001331&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1c&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.DateTime&amp;nbsp; 1 instance 03b2c690 _utcCreated&lt;br&gt;120219d0&amp;nbsp; 4001332&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 24&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.DateTime&amp;nbsp; 1 instance 03b2c698 _utcExpires&lt;br&gt;1202af88&amp;nbsp; 4001333&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2c&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.TimeSpan&amp;nbsp; 1 instance 03b2c6a0 _slidingExpiration&lt;br&gt;0fb8f1f8&amp;nbsp; 4001334&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; d&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.Byte&amp;nbsp; 0 instance&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 7 _expiresBucket&lt;br&gt;123062d8&amp;nbsp; 4001335&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 34 ...g.ExpiresEntryRef&amp;nbsp; 1 instance 03b2c6a8 _expiresEntryRef&lt;br&gt;0fb8f1f8&amp;nbsp; 4001336&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; e&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.Byte&amp;nbsp; 0 instance 4294967295 _usageBucket&lt;br&gt;12306738&amp;nbsp; 4001337&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 38 ...ing.UsageEntryRef&amp;nbsp; 1 instance 03b2c6ac _usageEntryRef&lt;br&gt;120219d0&amp;nbsp; 4001338&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3c&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.DateTime&amp;nbsp; 1 instance 03b2c6b0 _utcLastUpdate&lt;br&gt;123046c4&amp;nbsp; 4001339&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 14 ...g.CacheDependency&amp;nbsp; 0 instance 00000000 _dependency&lt;br&gt;02c36ca0&amp;nbsp; 400133a&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 18&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.Object&amp;nbsp; 0 instance 033d8344 _onRemovedTargets&lt;br&gt;120219d0&amp;nbsp; 400132d&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1bc&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.DateTime&amp;nbsp; 1&amp;nbsp;&amp;nbsp; shared&amp;nbsp;&amp;nbsp; static NoAbsoluteExpiration&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;gt;&amp;gt; Domain:Value&amp;nbsp; 0019daf0:NotInit&amp;nbsp; 11b42540:03395104 &amp;lt;&amp;lt;&lt;br&gt;1202af88&amp;nbsp; 400132e&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1c0&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.TimeSpan&amp;nbsp; 1&amp;nbsp;&amp;nbsp; shared&amp;nbsp;&amp;nbsp; static NoSlidingExpiration&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;gt;&amp;gt; Domain:Value&amp;nbsp; 0019daf0:NotInit&amp;nbsp; 11b42540:03395114 &amp;lt;&amp;lt;&lt;br&gt;1202af88&amp;nbsp; 400132f&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1c4&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.TimeSpan&amp;nbsp; 1&amp;nbsp;&amp;nbsp; shared&amp;nbsp;&amp;nbsp; static OneYear&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;gt;&amp;gt; Domain:Value&amp;nbsp; 0019daf0:NotInit&amp;nbsp; 11b42540:03395124 &amp;lt;&amp;lt;&lt;/div&gt; &lt;p&gt;This dumped the&amp;nbsp;CacheEntry and it's properties. I figured the most interesting piece of information would be the _value, so&amp;nbsp;I simply copied the address of that property (look in the Value column) and used !dumpobject again.&lt;/p&gt; &lt;div class="DebugSample"&gt;0:000&amp;gt; !do 03e160c8 &lt;br&gt;&lt;font color="#ff0000"&gt;Name: System.Web.SessionState.InProcSessionState&lt;br&gt;&lt;/font&gt;MethodTable: 14dbad5c&lt;br&gt;EEClass: 14e43af8&lt;br&gt;Size: 48(0x30) bytes&lt;br&gt;(C:\WINDOWS\assembly\GAC_32\System.Web\2.0.0.0__b03f5f7f11d50a3a\System.Web.dll)&lt;br&gt;Fields:&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MT&amp;nbsp;&amp;nbsp;&amp;nbsp; Field&amp;nbsp;&amp;nbsp; Offset&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Type VT&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Attr&amp;nbsp;&amp;nbsp;&amp;nbsp; Value Name&lt;br&gt;1466c9d8&amp;nbsp; 4001d89&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 4 ...ateItemCollection&amp;nbsp; 0 instance 1a7f5438 _sessionItems&lt;br&gt;1292672c&amp;nbsp; 4001d8a&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 8 ...ObjectsCollection&amp;nbsp; 0 instance 00000000 _staticObjects&lt;br&gt;0fd3da00&amp;nbsp; 4001d8b&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; c&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.Int32&amp;nbsp; 0 instance&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 20 _timeout&lt;br&gt;120261c8&amp;nbsp; 4001d8c&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 18&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.Boolean&amp;nbsp; 0 instance&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0 _locked&lt;br&gt;120219d0&amp;nbsp; 4001d8d&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1c&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.DateTime&amp;nbsp; 1 instance 03e160e4 _utcLockDate&lt;br&gt;0fd3da00&amp;nbsp; 4001d8e&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 10&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.Int32&amp;nbsp; 0 instance&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1 _lockCookie&lt;br&gt;1202bf60&amp;nbsp; 4001d8f&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 24 ...ReadWriteSpinLock&amp;nbsp; 1 instance 03e160ec _spinLock&lt;br&gt;0fd3da00&amp;nbsp; 4001d90&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 14&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.Int32&amp;nbsp; 0 instance&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0 _flags&lt;/div&gt; &lt;p&gt;Here I found something interesting. The value stored was in fact an InProcSessionState object, which -in case&amp;nbsp;you didn't know this before- is stored in the Cache.&amp;nbsp;This meant that the claim that the application was using SQL Server Session state was incorrect. &lt;/p&gt; &lt;p&gt;As it turned out the customer had temporarily switched to In-process for a brief test, but forgotten to switch back again. Had the application been live they would have spotted this in no time, but since they were stress testing they weren't really paying attention to &lt;em&gt;what&lt;/em&gt; the server was returning as long as it returned &lt;em&gt;something&lt;/em&gt;. Unknowingly running session state in-process compromised the stress-test in a number of ways.&amp;nbsp;For example:&lt;/p&gt; &lt;ul&gt; &lt;li&gt;Memory usage for the worker process was a lot higher than expected&lt;/li&gt; &lt;li&gt;The load on the network was not as high as it would be under normal circumstances&lt;/li&gt; &lt;li&gt;The response times were no longer accountable&lt;/li&gt; &lt;li&gt;The SQL-server was not stressed to the extent it should have been, so any potential bottlenecks there went unnoticed&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;This was in no way the final solution for their performance issue. There were a lot more things we had to deal with, but I think it's a really nice example of how to use only three commands (!dumpheap, !objsize &amp;amp; !dumpobject) to dig up some really useful information.&lt;/p&gt; &lt;p&gt;Later! / Johan&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=6531187" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/johan/archive/tags/SessionState/default.aspx">SessionState</category><category domain="http://blogs.msdn.com/johan/archive/tags/WinDbg/default.aspx">WinDbg</category><category domain="http://blogs.msdn.com/johan/archive/tags/Managed+Heap/default.aspx">Managed Heap</category><category domain="http://blogs.msdn.com/johan/archive/tags/Tools/default.aspx">Tools</category><category domain="http://blogs.msdn.com/johan/archive/tags/Cache/default.aspx">Cache</category><category domain="http://blogs.msdn.com/johan/archive/tags/Debugging+School/default.aspx">Debugging School</category><category domain="http://blogs.msdn.com/johan/archive/tags/ASP.NET/default.aspx">ASP.NET</category></item><item><title>Clients getting incorrect session data or sessions are inexplicably reset</title><link>http://blogs.msdn.com/johan/archive/2007/11/02/clients-getting-incorrect-session-data-or-sessions-are-inexplicably-reset.aspx</link><pubDate>Fri, 02 Nov 2007 17:41:22 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:5837498</guid><dc:creator>JohanS</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/johan/comments/5837498.aspx</comments><wfw:commentRss>http://blogs.msdn.com/johan/commentrss.aspx?PostID=5837498</wfw:commentRss><description>&lt;p&gt;This is something me and my colleagues come across quite often. It is often quite time consuming to troubleshoot, even though there aren't that many possible reasons.&lt;/p&gt; &lt;p&gt;The typical scenario is that a webapplication stores client-specific data in session variables. Intermittently clients will see other clients' data, find that their session has been reset long before the timeout, or receive an IndexOutOfBounds, NullReference-exception or similar, since their session data&amp;nbsp;suddenly appears corrupt or compromised.&lt;/p&gt; &lt;h1&gt;Moving to Production&lt;/h1&gt; &lt;p&gt;Unfortunately this problem is normally identified first when the application is in production. Normally you don't pay too much attention to the actual data presented during stress tests. Instead you focus on making sure that the response times are within an acceptable range and at best you only throw a quick glance at the web page to ensure that it &lt;em&gt;looks&lt;/em&gt; okay. The discovery that you have a glitch in session state is made in production by the actual clients.&lt;/p&gt; &lt;h1&gt;Don't blame the Framework&lt;/h1&gt; &lt;p&gt;The first thing you hear is usually: - This &lt;strong&gt;has&lt;/strong&gt; to be a bug in the framework.&amp;nbsp;I can almost assure you that&amp;nbsp;it isn't.&amp;nbsp;It's usually cache, code or configuration that's to blame.&lt;/p&gt; &lt;h1&gt;The usual suspects&lt;/h1&gt; &lt;ul&gt; &lt;li&gt;Caching&lt;/li&gt; &lt;li&gt;Static objects&lt;/li&gt; &lt;li&gt;Cookieless sessions&lt;/li&gt; &lt;li&gt;Process recycling&lt;/li&gt; &lt;li&gt;Load balancing&lt;/li&gt; &lt;li&gt;Incorrect data retrieval&lt;/li&gt;&lt;/ul&gt; &lt;h2&gt;Caching&lt;/h2&gt; &lt;p&gt;I normally begin troubleshooting these issues by disabling all caching. Remove all &amp;lt;@ OutputCache &amp;gt;-directives from the .aspx-pages and, if you're running Framework 2.0, verify that the outputCache-element is set up correctly in the machine.config and web.configs.&lt;/p&gt; &lt;p&gt;Normally you wouldn't cache client-specific data anyway, so disabling the cache for the affected pages shouldn't have any impact on performance.&lt;/p&gt; &lt;p&gt;You should also investigate what happens on the way from the client to the server. Is the page cached in a proxy in mid-transit? Is the page even requested at all or is it simply retrieved from the browser cache?&lt;/p&gt; &lt;p&gt;Network traces and IIS-logs are a great tool for verifying that the request actually reaches the server, and that the response is, in fact, returned properly.&lt;/p&gt; &lt;h2&gt;Static objects&lt;/h2&gt; &lt;p&gt;Static objects and ASP.NET can cause &lt;a href="http://support.microsoft.com/Default.aspx?id=893666"&gt;headaches&lt;/a&gt; sometimes. The common scenario with session state and static objects is that two clients are using&amp;nbsp;a static object at the same time and one client manages to change it while another is reading it. If you have static objects in your code I suggest you investigate thoroughly, possibly eliminate them temporarily for testing purposes and see if the problem still reproduces.&lt;/p&gt; &lt;h2&gt;Cookieless sessions&lt;/h2&gt; &lt;p&gt;When you use cookieless sessions you store the session ID in the URL. That's not really a safe alternative and not something I'd recommend for applications with sensitive client data. Also,&amp;nbsp;saving bookmarks, etc. can cause all sorts of weird situations when you try to access the application with a non-existing session ID, or even a re-used one that now belongs to a completely different client.&lt;/p&gt; &lt;h2&gt;Process recycling&lt;/h2&gt; &lt;p&gt;If you're just loosing session data and are using in-process session state, then the cause is most likely to be the w3wp itself. Is the process recycling at the default intervals? Have you changed any of the settings in IIS manager so that it recycles after 300 request? Are you writing to the bin-directory, etc? I wrote a post on &lt;a href="http://blogs.msdn.com/johan/archive/2007/05/16/common-reasons-why-your-application-pool-may-unexpectedly-recycle.aspx"&gt;common reasons why your application pool may unexpectedly recycle&lt;/a&gt;&amp;nbsp;earlier. If you suspect that this is what's happening I suggest you check it out.&lt;/p&gt; &lt;h2&gt;Load balancing&lt;/h2&gt; &lt;p&gt;Another reason why sessions may reset or possibly even jump between clients is load balancing. Make sure you have configured the state server correctly on all servers and haven't accidentally switched to in-process session state or have one configuration server 1 and another for server 2.&lt;/p&gt; &lt;h2&gt;Incorrect data retrieval&lt;/h2&gt; &lt;p&gt;If the client is seeing incorrect data you may need to verify that this data is retrieved correctly. By adding trace info to the code, tracking the session ID, and the variables used to retrieve the customer-specific data you may find that there is actually something wrong in the way the data is retrieved, rather than in the session ID.&lt;/p&gt; &lt;h1&gt;Conclusion&lt;/h1&gt; &lt;p&gt;If this problem happens to you, be prepared to spend a bit of time troubleshooting it. It usually takes a while to figure out where things go wrong. In order to avoid unpleasant surprises you should really take the time to verify that the correct data is displayed before deploying. It is far too easy to stare at the response times and forget about verifying that the data displayed is actually the data you'd expect.&lt;/p&gt; &lt;p&gt;/ Johan&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=5837498" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/johan/archive/tags/SessionState/default.aspx">SessionState</category><category domain="http://blogs.msdn.com/johan/archive/tags/ASP.NET/default.aspx">ASP.NET</category></item><item><title>My web application times out when debugging in IIS7</title><link>http://blogs.msdn.com/johan/archive/2007/09/12/my-web-application-times-out-when-debugging-in-iis7.aspx</link><pubDate>Wed, 12 Sep 2007 16:51:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:4879888</guid><dc:creator>JohanS</dc:creator><slash:comments>4</slash:comments><comments>http://blogs.msdn.com/johan/comments/4879888.aspx</comments><wfw:commentRss>http://blogs.msdn.com/johan/commentrss.aspx?PostID=4879888</wfw:commentRss><description>&lt;H1&gt;Problem:&lt;/H1&gt;
&lt;P&gt;When using Visual Studio 2005 to debug a web application under IIS7 you will find that after 90-120 seconds the debugger will time out and you will get an appropriate error message in your browser. Visual Studio will return to it's "non debugging"-state and pretend like nothing happened.&lt;/P&gt;
&lt;P&gt;Changing the ExecutionTimout property in web.config doesn't change anything, and since you're debugging you'd expect IIS to ignore that setting anyway.&lt;/P&gt;
&lt;H1&gt;Cause:&lt;/H1&gt;
&lt;P&gt;With every new software release there are always small changes that will effect performance / behavior in certain situations. I've mentioned this before in my &lt;A href="http://blogs.msdn.com/johan/archive/2007/01/23/i-ve-upgraded-and-now-my-application-doesn-t-work-anymore.aspx" target=_blank mce_href="http://blogs.msdn.com/johan/archive/2007/01/23/i-ve-upgraded-and-now-my-application-doesn-t-work-anymore.aspx"&gt;I've upgraded and now my application doesn't work anymore&lt;/A&gt;&amp;nbsp;- post. There are always a few scenarios in which a new feature will appear to limit functionality when it is in fact increasing it.&lt;/P&gt;
&lt;P&gt;IIS will periodically ping your worker process in order to ensure that it is still responsive. By default it will be pinging the process every 30 seconds, and the process will have 90 seconds to respond. If it doesn't respond in time it is terminated.&amp;nbsp;All in all this means that If your application pool has hung for some reason it will be recycled and everything will return to normal.&lt;/P&gt;
&lt;P&gt;This is not a new feature, but it can, however, cause some problems while debugging. When you hit a breakpoint all execution stops, pending requests are not served and the worker process freezes completely. It will not respond to the health monitoring ping and if it doesn't continue execution within this 90-120 window it will be terminated.&lt;/P&gt;
&lt;H1&gt;Resolution:&lt;/H1&gt;
&lt;P&gt;There are three settings you can tweak with to resolve this. You'll find them all in the "Process Model"-section of the Advanced Settings for the Application Pool:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Open up the IIS manager 
&lt;LI&gt;Locate the Application Pool in question 
&lt;LI&gt;Right-click on it and select "Advanced Settings" 
&lt;LI&gt;Scroll down to the "Process Model"-section&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;The settings of interest, and their default values are:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Ping Enabled (True) 
&lt;LI&gt;Ping Maximum Response Time (90 seconds) 
&lt;LI&gt;Ping Period (30 seconds)&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;This means you can either turn off health monitoring altogether by setting "Ping Enabled" to false, or you can tweak with the response time or the interval. Please note that the settings are there for a reason, so once you're getting close to production you really should return them back to their default values. I personally think the settings are excellent. An application pool that has hung will be reset within a maximum of 2 minutes. With a decent &lt;A href="http://blogs.msdn.com/johan/archive/2006/11/20/sessionstate-performance.aspx" target=_blank mce_href="http://blogs.msdn.com/johan/archive/2006/11/20/sessionstate-performance.aspx"&gt;out of process State Server&lt;/A&gt; setup your clients will probably notice an unusually long response time for one request, but think nothing else of it. &lt;/P&gt;
&lt;P&gt;Over and out / Johan&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=4879888" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/johan/archive/tags/SessionState/default.aspx">SessionState</category><category domain="http://blogs.msdn.com/johan/archive/tags/Worker+Process/default.aspx">Worker Process</category><category domain="http://blogs.msdn.com/johan/archive/tags/IIS7/default.aspx">IIS7</category><category domain="http://blogs.msdn.com/johan/archive/tags/ASP.NET/default.aspx">ASP.NET</category></item><item><title>Common reasons why your application pool may unexpectedly recycle</title><link>http://blogs.msdn.com/johan/archive/2007/05/16/common-reasons-why-your-application-pool-may-unexpectedly-recycle.aspx</link><pubDate>Wed, 16 May 2007 11:12:27 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:2667825</guid><dc:creator>JohanS</dc:creator><slash:comments>7</slash:comments><comments>http://blogs.msdn.com/johan/comments/2667825.aspx</comments><wfw:commentRss>http://blogs.msdn.com/johan/commentrss.aspx?PostID=2667825</wfw:commentRss><description>&lt;p&gt;If your application crashes, hangs and deadlocks it will cause/require the application pool to recycle in order to be resolved, but sometimes your application pool inexplicably recycles for no obvious reason. This is usually a configuration issue or&amp;nbsp;due to the fact that you're performing&amp;nbsp;file system operations in the application directory.&lt;/p&gt; &lt;p&gt;For the sake of elimination I thought I'd list the most common reasons.&lt;/p&gt; &lt;h1&gt;&amp;nbsp;&lt;/h1&gt; &lt;h1&gt;Application pool settings&lt;/h1&gt; &lt;p&gt;If you&amp;nbsp;check the properties for the application pool you'll see a number of settings for recycling the application pool. In IIS6 they are:&lt;/p&gt; &lt;ul&gt; &lt;li&gt;Recycle worker processes (in minutes)  &lt;li&gt;Recycle worker process (in requests)  &lt;li&gt;Recycle worker processes at the following times  &lt;li&gt;Maximum virtual memory  &lt;li&gt;Maximum used memory&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;These settings should be pretty self explanatory, but if you want to read more, please take a look at &lt;a href="http://msdn2.microsoft.com/en-us/library/aa720473(VS.71).aspx"&gt;this MSDN article&lt;/a&gt;&lt;/p&gt; &lt;h1&gt;&amp;nbsp;&lt;/h1&gt; &lt;h1&gt;The processModel element of machine.config&lt;/h1&gt; &lt;p&gt;If you're running IIS5 or the IIS5 isolation mode you'll have to look at the processModel element. The Properties you should pay the closest attention to are:&lt;/p&gt; &lt;ul&gt; &lt;li&gt;memoryLimit  &lt;li&gt;requestLimit  &lt;li&gt;timeout&lt;/li&gt;&lt;/ul&gt; &lt;h2&gt;memoryLimit&lt;/h2&gt; &lt;p&gt;The default value of memoryLimit is 60. This value is only of interest if you have fairly little memory on a 32 bit machine. 60 stands for 60% of total system memory. So if you have 1 GB of memory the worker process will automatically restart once it reaches a memory usage of 600 MB. If you have 8 GB, on the other hand, the process would &lt;em&gt;theoretically&lt;/em&gt; restart when it reaches 4,8 GB, but since it is a 32 bit process it will never grow that big. See &lt;a href="http://blogs.msdn.com/johan/archive/2007/04/19/why-adding-more-memory-won-t-resolve-outofmemoryexceptions.aspx"&gt;my post on 32 bit processes&lt;/a&gt;&amp;nbsp;for more information why.&lt;/p&gt; &lt;h2&gt;requestLimit&lt;/h2&gt; &lt;p&gt;This setting is "infinite" by default, but if it is set to 5000 for example, then ASP.NET will launch a new worker process once it's served 5000 requests.&lt;/p&gt; &lt;h2&gt;timeout&lt;/h2&gt; &lt;p&gt;The default timeout is "infinite", but here you can set the lifetime of the worker process. Once the timeout is reached ASP.NET will launch a new worker process, so setting this to "00:05:00" would recycle the application every five minutes.&lt;/p&gt; &lt;h2&gt;Other properties&lt;/h2&gt; &lt;p&gt;There are other properties within the processModel element that will cause your application pool to recycle, like responseDeadlockInterval. But these other settings usually depend on something going wrong or being out of the ordinary to trigger. If you have a deadlock then that's your main concern. Changing the responseDeadlockInterval&amp;nbsp;setting wouldn't do much to resolve the situation. You'd need to deal with the deadlock itself.&lt;/p&gt; &lt;h1&gt;&amp;nbsp;&lt;/h1&gt; &lt;h1&gt;Editing and updating&lt;/h1&gt; &lt;p&gt;ASP.NET 2.0 depends on File Change Notifications (FCN) to see if the application has been updated. Depending on the change the application pool will recycle. If you or your application is adding and removing directories to the application folder, then you will be restarting your application pool every time, so be careful with those temporary files.&lt;/p&gt; &lt;p&gt;Altering the following files will also trigger an immediate restart of the application pool:&lt;/p&gt; &lt;ul&gt; &lt;li&gt;web.config  &lt;li&gt;machine.config  &lt;li&gt;global.asax  &lt;li&gt;Anything in the bin directory or it's sub-directories&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;Updating the .aspx files, etc.&amp;nbsp;causing a recompile will eventually trigger a restart of the application pool as well. There is a property of the compilation element under system.web that is called numRecompilesBeforeAppRestart. The default value is 20. This means that after 20 recompiles the application pool will recycle.&lt;/p&gt; &lt;h2&gt;A workaround to the sub-directory issue&lt;/h2&gt; &lt;p&gt;If your application really depends on adding and removing sub-directories you can use linkd to create a directory junction. Here's how:&lt;/p&gt; &lt;ul&gt; &lt;li&gt;Create a directory you'd like to exclude from the FCN, E.g. c:\inetpub\wwwroot\WebApp\MyDir  &lt;li&gt;Create a separate folder somewhere outside the wwwroot. E.g. c:\MyExcludedDir  &lt;li&gt;use linkd to link the two: linkd c:\inetpub\wwwroot\WebApp\MyDir c:\MyExcludedDir  &lt;li&gt;Any changes made in the c:\inetpub\wwwroot\WebApp\MyDir will actually occur in c:\MyExcludedDir so they will go unnoticed by the&amp;nbsp;FCN.&lt;/li&gt;&lt;/ul&gt; &lt;h1&gt;Is recycling the application pool really that bad?&lt;/h1&gt; &lt;p&gt;You really shouldn't have to recycle the application pool, but if you're dealing with a memory leak in your application and need to buy time to fix it, then by all means recycling the application pool could be a good idea.&lt;/p&gt; &lt;h1&gt;&amp;nbsp;&lt;/h1&gt; &lt;h1&gt;What about session state?&lt;/h1&gt; &lt;p&gt;Well, if you're running in-process session state, then obviously it's going to be reset each and every time the application pool is recycled. If you need to brush up on your state server options, then I recommend taking a look at &lt;a href="http://blogs.msdn.com/johan/archive/2006/11/20/sessionstate-performance.aspx"&gt;this entry&lt;/a&gt;.&lt;/p&gt; &lt;p&gt;Later! / Johan&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=2667825" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/johan/archive/tags/Performance/default.aspx">Performance</category><category domain="http://blogs.msdn.com/johan/archive/tags/SessionState/default.aspx">SessionState</category><category domain="http://blogs.msdn.com/johan/archive/tags/Worker+Process/default.aspx">Worker Process</category><category domain="http://blogs.msdn.com/johan/archive/tags/ASP.NET/default.aspx">ASP.NET</category></item><item><title>SessionState Performance</title><link>http://blogs.msdn.com/johan/archive/2006/11/20/sessionstate-performance.aspx</link><pubDate>Mon, 20 Nov 2006 11:49:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1107563</guid><dc:creator>JohanS</dc:creator><slash:comments>11</slash:comments><comments>http://blogs.msdn.com/johan/comments/1107563.aspx</comments><wfw:commentRss>http://blogs.msdn.com/johan/commentrss.aspx?PostID=1107563</wfw:commentRss><description>&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;H1&gt;Problem:&lt;/H1&gt;
&lt;P&gt;Unable to make the session state request to the session state server.&lt;BR&gt;Please ensure that the ASP.NET State service is started and that the client and server ports are the same.&lt;BR&gt;If the server is on a remote machine, please ensure that it accepts remote requests by checking the value of &lt;SPAN class=InlineCode&gt;HKLM\SYSTEM\CurrentControlSet\Services\aspnet_state\Parameters\AllowRemoteConnection&lt;/SPAN&gt;. &lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;H1&gt;Cause:&lt;/H1&gt;
&lt;P&gt;Excessive use of SessionState &lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;H1&gt;Resolution:&lt;/H1&gt;
&lt;P&gt;Minor tweaks can be made, but be aware. You are pushing SessionState to it's absolute limits. &lt;/P&gt;
&lt;HR&gt;

&lt;H1&gt;Scenario:&lt;/H1&gt;
&lt;P&gt;Judging from the number of calls we get it seems quite common for people to store all sorts of things in SessionState and to rely quite heavily on it. I would personally say that the rule of thumb is to avoid SessionState as much as possible. &lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;H1&gt;The different ways of storing SessionState&lt;/H1&gt;
&lt;P&gt;You're probably already familiar with the three different ways of storing SessionState, but I'll recap them quickly, just to refresh your memory: &lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;
&lt;H2&gt;InProc&lt;/H2&gt;In process. Works fine if you have only one web server. Great performance, but if the application pool recycles, then your SessionData is lost forever. 
&lt;LI&gt;
&lt;H2&gt;State Server&lt;/H2&gt;The simple out-of process solution. By using the ASP.NET State Server you can share data between web servers. The ASP.NET State Server can be run either on one of the web servers or on a separate server. 
&lt;LI&gt;
&lt;H2&gt;SQL Server&lt;/H2&gt;Using SQL server isn't that different from using the State Server. SQL Server may be a tiny bit slower performance-wise, but the main benefit is that you can set up a fail-over cluster.&lt;/LI&gt;&lt;/UL&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;H1&gt;Common myths&lt;/H1&gt;
&lt;P&gt;There are some common misunderstandings regarding SessionState and it's uses. The ones I come across most frequently would probably be the following: &lt;/P&gt;
&lt;H2&gt;Myth:&lt;/H2&gt;"SessionState is really efficient. If you store all datasets, etc. in a SessionVariable it's like having the data in RAM, rather than on disk" 
&lt;H2&gt;Fact:&lt;/H2&gt;When storing session data out of process it is serialized, stored and deserialized. This is a CPU-&amp;nbsp;and memory consuming process and if you store large objects in SessionState you will use a lot of resources to handle the data. For small chunks of data I'd recommend cookies, hidden controls (ViewState)&amp;nbsp;or even query strings. For larger objects... Well, do you really need them for every single request? 
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;H2&gt;&amp;nbsp;&lt;/H2&gt;
&lt;H2&gt;Myth:&lt;/H2&gt;"The Server will only retrieve SessionState when I actually read or write to it." 
&lt;H2&gt;Fact:&lt;/H2&gt;Sorry, but that's incorrect as well. The data will be deserialized and serialized with each request unless you have clearly specified otherwise. 
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;H2&gt;&amp;nbsp;&lt;/H2&gt;
&lt;H2&gt;Myth:&lt;/H2&gt;"It doesn't matter what type of data I store in SessionState." 
&lt;H2&gt;Fact:&lt;/H2&gt;It does matter, and it matters a lot. For example; a 40KB string and a 40KB multi-dimensional array are not equivalent. The data must be serialized and deserialized, and serializing a string is a lot less CPU-consuming than serializing a complex array. 
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;H1&gt;&amp;nbsp;&lt;/H1&gt;
&lt;H1&gt;What is serialization anyway?&lt;/H1&gt;
&lt;P&gt;Serialization means transforming an object to a stream of bytes. This stream of bytes can then be sent over the web, saved to disk, etc. and be recreated on demand. When serializing the worker process takes your complex object and transform it to a simple byte stream that is easily dealt with.&amp;nbsp;This byte stream in itself is pretty useless until you deserialize it. You can not access its properties until you've "unpacked it". Think of it as a .cab archive or instant coffee. :) &lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;H1&gt;Increasing performance&lt;/H1&gt;
&lt;P&gt;If you are aware from the start that SessionState isn't the most effective way to store data, then you should be fine. If you're stuck with the ungrateful task of cleaning up someone else's mess, then you have a little more work to do.&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;H2&gt;The planning phase&lt;/H2&gt;
&lt;P&gt;Like I said, you should always try to limit your use of SessionState. It's quite common to store data "for later use", but unless you absolutely need it right now, then why store it in Session State? And if you absolutely need it right now, then why not use ViewState, cookies&amp;nbsp;or some other means of temporary storage like a database? Here are some samples: &lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;If you have a huge dataset that was really taxing to get, then save it to a temporary table or take it as a hint to rethink your database design. 
&lt;LI&gt;Form data should be kept in ViewState or possibly in cookies. 
&lt;LI&gt;Try really, really hard to keep Objects out of SessionState. Especially STA COM objects. If you really have to save an STA COM object, then remember to set the &lt;SPAN class=InlineCode&gt;AspCompat&lt;/SPAN&gt; attribute of the &lt;SPAN class=InlineCode&gt;@ Page&lt;/SPAN&gt; directive. 
&lt;LI&gt;Disable Session State on all pages that don't require it, and set it to read-only on pages that don't require write-access. This is done with &lt;SPAN class=InlineCode&gt;&amp;lt;@ Page EnableSessionState="..."&amp;gt;&lt;/SPAN&gt; (Framework 2.0) 
&lt;LI&gt;Read the article &lt;A href="http://msdn2.microsoft.com/en-us/library/ms998530.aspx" target=_blank mce_href="http://msdn2.microsoft.com/en-us/library/ms998530.aspx"&gt;Improving .NET Application Performance and Scalability&lt;/A&gt;. Especially &lt;A href="http://msdn2.microsoft.com/en-us/library/ms998549.aspx" target=_blank mce_href="http://msdn2.microsoft.com/en-us/library/ms998549.aspx"&gt;Chapter 6&lt;/A&gt;&amp;nbsp;which deals with ASP.NET.&lt;/LI&gt;&lt;/UL&gt;
&lt;H2&gt;Existing applications&lt;/H2&gt;
&lt;P&gt;There are a few things worth tryng if you're running an application and suddenly find yourself with a StateServer on it's knees begging for mercy. Please note that most of this is to be considered respiratory only. A few more users and you'll probably be facing the same scenario again. So my personal suggestion would probably be to quickly get the server up and running within acceptable parameters and then immediately begin working on a redesign. Anyway. here are my quick tips for a quick fix:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Disable Session State on all pages that don't use it, or set it to read-only by using the &lt;SPAN class=InlineCode&gt;EnableSessionState&lt;/SPAN&gt; attribute in the &lt;SPAN class=InlineCode&gt;@ Page&lt;/SPAN&gt; directive (Framework 2.0) 
&lt;LI&gt;If you've hit the ceiling and are running the in-process state server, then there might be some extra performance to be gained by setting up an out-of process State Server on a separate machine. 
&lt;LI&gt;If you're using the out of process StateServer, then you might want to increase the timeout according to the following article:&lt;BR&gt;&lt;A href="http://support.microsoft.com/?kbid=308097" target=_blank mce_href="http://support.microsoft.com/?kbid=308097"&gt;State server logs Event ID 1072 or Event ID 1076&lt;/A&gt; 
&lt;LI&gt;You might also want to increase the available number of ports on the StateServer by following the guidelines in this article: (I know it doesn't mention StateServer, but the solution is the same.)&lt;BR&gt;&lt;A href="http://support.microsoft.com/?kbid=319502" target=_blank mce_href="http://support.microsoft.com/?kbid=319502"&gt;PRB: "WSAEADDRESSINUSE" Error Message When You Try to Connect Through an Anonymous Port After You Increase the IMAP Connection Limit&lt;/A&gt; 
&lt;LI&gt;There is also a possibility that this fix will help you out:&lt;BR&gt;&lt;A href="http://support.microsoft.com/?kbid=896600" target=_blank mce_href="http://support.microsoft.com/?kbid=896600"&gt;FIX: You may receive an error message when you use the ASP.NET State Server service to store ASP.NET session state in the .NET Framework 1.1&lt;/A&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;H1&gt;More than one StateServer:&lt;/H1&gt;
&lt;P&gt;If all else fails you can actually have more than one StateServer, provided that you have a webfarm. If you set up your load balancer to use sticky sessions you could actually run each web server with its own StateServer. This would mean that each web server would have its own settings for SessionState. This gives you many options for load balancing. If you, for example, have 8 web servers you could divide the servers into pairs and let each pair share an out of process&amp;nbsp;StateServer. This would give you a solution with 8 web server and 4 state servers. You could even have a separate fail-over cluster for each web server. But as much as this would please your hardware vendor you're probably&amp;nbsp;compensating&amp;nbsp;for poor planning by adding horsepower.&lt;/P&gt;
&lt;P&gt;Well I guess that's all for now.&lt;/P&gt;
&lt;P&gt;/ Johan&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=1107563" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/johan/archive/tags/Performance/default.aspx">Performance</category><category domain="http://blogs.msdn.com/johan/archive/tags/SessionState/default.aspx">SessionState</category><category domain="http://blogs.msdn.com/johan/archive/tags/ASP.NET/default.aspx">ASP.NET</category></item></channel></rss>