title: System.Runtime.InteropServices.COMException (0x80070008): Not enough storage is available to process this command
body: <p>I am trying to diagnose this exception :</p>
  
  <pre><code>System.Runtime.InteropServices.COMException (0x80070008): Not enough storage is available to process this command. (Exception from HRESULT: 0x80070008)
  at System.Runtime.Remoting.RemotingServices.AllocateUninitializedObject(RuntimeType objectType)
  at System.Runtime.Remoting.RemotingServices.AllocateUninitializedObject(Type objectType)
  at System.Runtime.Remoting.Activation.ActivationServices.CreateInstance(Type serverType)
  at System.Runtime.Remoting.Activation.ActivationServices.IsCurrentContextOK(Type serverType, Object[] props, Boolean bNewObj)
  at Oracle.DataAccess.Client.CThreadPool..ctor()
  at Oracle.DataAccess.Client.OracleCommand.set_CommandTimeout(Int32 value)
  ...
  </code></pre>
  
  <p>It does not look like any of the normal types of "storage" have hit any limits.  The application is using about 400MB of memory, 70 threads, 2000 handles and the hard drive has many GB free. The machine is running Windows 2003 Enterprise Server 32bit with 16GB of RAM so memory shouldn't be an issue.</p>
  
  <p>The application is running as a windows service so there are no GDI objects being used. Running out of GDI handles is a common cause of this exception. </p>
  
  <p>Database connections, commands &amp; readers are all all wrapped with using blocks so they should be getting cleaned up correctly. </p>
  
  <p><strong>UPDATE:</strong> Reducing the number of threads we were using from 12 to 4 seems to have fixed the issue.  We managed to run with no errors for over 24 hours, before we were lasting between 4 and 8 hours. 
  <strong>UPDATE2:</strong> I never figured out what resource we were running out of, but reducing the number of threads seems to have fixed the problem. Or at least hid it.</p>