<p>We have a web service that uses up more and more private bytes until that application stops responding.  The managed heap (mostly Gen2) will show some 200-250 MB, while private bytes shows over 1GB.  What are possible causes of a memory leak outside of the managed heap?</p>

<p>I've already checked for the following:</p>

<ol>
<li>Prolific dynamic assemblies (Xml serialization, regex, etc.)</li>
<li>Session state (turned off)</li>
<li>System.Policy.Evidence memory leak (SP1 installed)</li>
<li>Threading deadlock (no use of Join, only lock)</li>
<li>Use of SQLOLEDB (using SqlClient)</li>
</ol>

<p>What other sources can I check for?</p>

Make sure your app is complied in release mode.  If you compile under debug mode, and deploy that, simply instantiating a class that has an event defined (event doesn't even need to be raised), will cause a small piece of memory to leak.  Instantiating enough of these objects over a long enough period of time will cause all the memory to be used.  I've seen web apps that would use up all the memory within a matter of hours, simply because a debug build was used.  Compiling as a release build immediately and permanently fixed the problem.