title: webbrowser control - releasing resources of an application
body: <p>My problem is that I created a simple application where I have webrowser control. It navigates every 20 seconds to a new site.  After some number of navigations memory occupied by the application increases. I tried to dispose, delete and create again the webrouser control, but couldn't succeed.  The only way to release all resources of the application is reboot it. I spent lots of effort  trying to solve this problem. Please, give me some hints or links where I can read about it. Thanks in advance.</p>
  
  <p>The actual code is much bigger than the demonstrated one, but the idea is the same. Code looks like this:</p>
  
  <pre><code>for (int i = 0; i &lt; 100000; i++)
  {
      webBrowser1.Navigate("http://stackoverflow.com");
      Wait(20000);
  }
  </code></pre>
  
  <p>Method definition:</p>
  
  <pre><code>private void Wait(long value)
  {
      Stopwatch sw = new Stopwatch();
      sw.Start();
  
      while (sw.ElapsedMilliseconds &lt; value)
          Application.DoEvents();
  }
  </code></pre>
  
  <p>Problem is not actual now because the solution is found by using another browser control named WebKitBrowser. Thanks for all who tried to help me. It was my first question on this briliant site. I liked it very much. </p>