title: Getting the details asp.net cache and session details from memory dump
body: <p>My application is in production for sometime and it has some classic asp and asp.net 4.5 code running. </p>
  
  <p><strong>Enviroment: Windows 2008 R2 Server
  Two servers,load balanced,In proc Session,Built in http Cache from system.web namespace</strong> </p>
  
  <p>With the latest deployment ,application started consuming large memory and am in the process of finding out where the memory usage is.</p>
  
  <p>I have a large memory dump captured for a high memory scenario and i am trying to figure out where the memory usage one by one.</p>
  
  <p><strong>!address -summary</strong></p>
  
  <pre><code>--- Usage Summary ---------------- RgnCount ----------- Total Size -------- %ofBusy %ofTotal
  Free                                    448          c9b0400 (   2.151 Gb)           78.79%
  &lt;unclassified&gt;                         2150          21b4a0000 ( 1539.289 Mb)  62.06%   13.17%
  Image                                  1367           d593000 ( 213.574 Mb)  24.58%    5.21%
  Stack                                   354           7385000 ( 115.520 Mb)  13.29%    2.82%
  TEB                                     118             76000 ( 472.000 kb)   0.05%    0.01%
  ActivationContextData                     8              f000 (  60.000 kb)   0.01%    0.00%
  CsrSharedMemory                           1              5000 (  20.000 kb)   0.00%    0.00%
  
  --- Type Summary (for busy) ------ RgnCount ----------- Total Size -------- %ofBusy %ofTotal
  MEM_PRIVATE                            1803          1f4b9000 ( 500.723 Mb)  57.63%   12.22%
  MEM_IMAGE                              2116          121f0000 ( 289.938 Mb)  33.37%    7.08%
  MEM_MAPPED                               79           4e43000 (  78.262 Mb)   9.01%    1.91%
  
  --- State Summary ---------------- RgnCount ----------- Total Size -------- %ofBusy %ofTotal
  MEM_FREE                                448          c9b04000 (   3.151 Gb)           78.79%
  MEM_COMMIT                             3151          23a5d0000 ( 1570.363 Mb)  65.64%   13.93%
  MEM_RESERVE                             847          12a8f000 ( 298.559 Mb)  34.36%    7.29%
  
  --- Protect Summary (for commit) - RgnCount ----------- Total Size -------- %ofBusy %ofTotal
  PAGE_EXECUTE_READ                       259           f091000 ( 240.566 Mb)  27.69%    5.87%
  PAGE_READWRITE                         1377           c80f000 ( 200.059 Mb)  23.02%    4.88%
  PAGE_READONLY                           679           4657000 (  70.340 Mb)   8.10%    1.72%
  PAGE_READWRITE|PAGE_WRITECOMBINE         17           2016000 (  32.086 Mb)   3.69%    0.78%
  PAGE_WRITECOPY                          311            e9f000 (  14.621 Mb)   1.68%    0.36%
  PAGE_EXECUTE_READWRITE                  212            921000 (   9.129 Mb)   1.05%    0.22%
  PAGE_READWRITE|PAGE_GUARD               236            239000 (   2.223 Mb)   0.26%    0.05%
  PAGE_EXECUTE_WRITECOPY                   60            157000 (   1.340 Mb)   0.15%    0.03%
  
  --- Largest Region by Usage ----------- Base Address -------- Region Size ----------
  Free                                        80010000          7fde6000 (   1.998 Gb)
  &lt;unclassified&gt;                               25b0000           1d78000 (  29.469 Mb)
  Image                                       61feb000            f4b000 (  15.293 Mb)
  Stack                                         ce0000             fd000 (1012.000 kb)
  TEB                                         ffdf8000              1000 (   4.000 kb)
  ActivationContextData                          50000              4000 (  16.000 kb)
  CsrSharedMemory                             7efe0000              5000 (  20.000 kb)
  </code></pre>
  
  <p>I have the GC heap and address data figured out and showing large memory usage</p>
  
  <p><strong>0:000> !eeheap -stat</strong></p>
  
  <pre><code>Number of GC Heaps: 1
  generation 0 starts at 0x273de070
  generation 1 starts at 0x273a1000
  generation 2 starts at 0x025b1000
  ephemeral segment allocation context: none
   segment     begin  allocated      size
  025b0000  025b1000  035aff50  0xffef50(167729448)
  0ea00000  0ea01000  0f9ffd20  0xffed20(167723848)
  19a20000  19a21000  1aa1fe54  0xffee54(167726928)
  2a750000  2a751000  2b6fb10c  0xfaa10c(164252288)
  263a0000  263a1000  26df1224  0xa50224(108139888)
  273a0000  273a1000  274a4c70  0x103c70(10640488)
  Large object heap starts at 0x035b1000
   segment     begin  allocated      size
  035b0000  035b1000  04307138  0xd56138(139840568)
  1dc60000  1dc61000  1e580050  0x91f050(95642408)
  20490000  20491000  206cc878  0x23b878(23409848)
  Total Size:              Size: 0x63ab464 (104510564) bytes.
  ------------------------------
  GC Heap Size:    Size: 0x63ab46445 (1045105648) bytes.
  </code></pre>
  
  <p>And also the dumpheap stat as well(it is not showing one particular object used all the memory but lot of objects(my guess)</p>
  
  <pre><code>05ef4e70     1615       516800 DevExpress.XtraEditors.ViewInfo.TextEditViewInfo   
  66418298    11091       763524 System.Windows.EffectiveValueEntry[]
  7219a874    24397       780704 System.EventHandler
  7219f680    10866       918152 System.Int32[]
  6592dc98     9502       932360 System.Xaml.XamlNode[]
  05ab1bf4     7180      1091360 DevExpress.Utils.AppearanceObject
  05ffd498     2010      1101480 Infragistics.Win.UltraWinGrid.UltraGridColumn
  72198390    19429      1165740 System.Reflection.RuntimeMethodInfo
  721a12a4     4261      1199184 System.Collections.Hashtable+bucket[]
  7219dc28    23649      1474820 System.Object[]
  721a2518    13502      7978588 System.Byte[]
  7219d834   237668     15219668 System.String
  003aa9b0    45181     37740118      Free
  Total 1282570 objects
  Fragmented blocks larger than 0.5 MB:
      Addr     Size      Followed by
  2b3cc938    0.5MB         2b454220 DevExpress.Xpo.Helpers.ObjectRecord
  2b454248    0.8MB         2b5295d8 DevExpress.Xpo.Helpers.ObjectRecord 
  2b6680b0    0.6MB         2b6f9e18 DevExpress.Utils.AppearanceObject
  </code></pre>
  
  <p>Please note that from above command I removed/edited some object names(as it is company specific but i think you got overall idea)</p>
  
  <p>We are storing lot of data in the session and cache and would like to check how much is stored for asp.net cache and session data. What is the best way to see this ?</p>