title: Finding memory leak in ASP.NET website with ANTS Memory Profiler?
body: <p>I have a ASP.NET FRAMEWORK 4.0 website that has a memory leak. To find it I have installed ANTS Memory Profiler.</p>
  
  <p>This is what I do : </p>
  
  <ol>
  <li>Host website in IIS7</li>
  <li>Start Ants Memory Profiler 8.1</li>
  <li>Set the we are profiling a IIS website and state the URL to this webpage (built in release)</li>
  <li>Start test and let the webpage startup (a lot of caching so about 1 min)</li>
  <li>Take Memory Snapshot when first page is loaded and stable</li>
  <li>Reload first page A LOT and see the memory raise from 110 MB (Private Bytes/Working Set -Private) to 270 MB</li>
  <li>Visit a lot of pages on the webpage and see it raise to 360 MB</li>
  <li>Push it some more and no more raise is done</li>
  <li>Take Memory Snapshot and click Class list (check Classes with source)</li>
  </ol>
  
  <p>This will show classes that are still kept for example </p>
  
  <pre><code>sites_mypage_default_asx - 10 320 bytes and 10 live instances
  usercontrols_common_pagehead_ascx - 928 bytes and 4 live instances
  </code></pre>
  
  <p>and so on</p>
  
  <p>I belive/hope that these are the classes that will be cleaned by the GC</p>
  
  <p>But this is not where the large foot print is, I have to uncheck the Classes with source to get the really large one. For example(sorted on Live size(byte)</p>
  
  <pre><code>string - 1 890 292 bytes
  RuntimeMethodInfo - 990 976 bytes
  RuntimePropertyInfo - 604 136 bytes
  Hastable+bucket[] - 413 712 bytes
  </code></pre>
  
  <p>and so on.</p>
  
  <p>The problem is that there is not much I can do about these, when opening Instance relation graph I will only see System. classes and there is no information about where thay are hold in my website.</p>
  
  <p>When the classes with source was checked I however found a big memory leak that could be fixed(this was before the above run). </p>
  
  <p>But I do not know how to take the next step? Why is my website still taking up 350 MB? 350 MB with data is a lot of data and I can´t see that I cache this much data!?</p>
  
  <p>What should be my next step?</p>