title: Interesting observation with IE memory management and javascript
body: <p>In windows, when an application is minimised the OS frees up memory associated with application by placing the data within a page file. Other garbage collection may also execute. </p>
  
  <p>In the case of internet explorer running my javascript app I find that if the memory usage starts at 60mb then minimising the browser reduces the memory to 17mb. Maximising then takes it back up to 40mb</p>
  
  <p>A 20mb gain. </p>
  
  <p>My application makes heavy use of javascript and I suspect that IE is forcing a garabage collection of the objects which are no longer referenced.</p>
  
  <p>Via javascript (IE only) you can force garbage collection via:</p>
  
  <pre><code>CollectGarbage()
  </code></pre>
  
  <p>So, if I call this method (without minimising the screen) I only reclaim a meg or 2.</p>
  
  <p>If I call this via the event queue:</p>
  
  <pre><code>setTimeout(CollectGarbage, 1000)
  </code></pre>
  
  <p>I reclaim around 3 meg</p>
  
  <p>My application is designed to run all day and so memory management is very important.</p>
  
  <p>Anybody got any ideas how to force IE to clean up its memory to the same extent that a manual minise does?</p>
  
  <p>Suggestions of programatically minimising the browser will be scoffed at!</p>
  
  <p>Cheers :)</p>