title: Recurring SQL Error 17189
body: <h3>Problem:</h3>
  <p>One of our clients has SQL Server 2005 running on a Windows 2008 R2 Standard machine. Every once in a while, the server fails with the following error:</p>
  <blockquote>
  <p>SQL Server failed with error code 0xc0000000 to spawn a thread to process a new login or connection. Check the SQL Server error log and the Windows event logs for information about possible related problems. [CLIENT: <code>&lt;local machine&gt;</code>]</p>
  </blockquote>
  <p>The error occurs at a rate of about once per second, with the value for <em>CLIENT:</em> being the only thing that changes (sometimes, instead of <code>&lt;local machine&gt;</code> it shows the IP of the machine or the IP of other machines belonging to the client) and until the SQL Server is restarted, no connections can be made to it. After the restart, it works fine.</p>
  <p>The problem happens about once or twice per month. There are no windows logs for the previous occurrence; I've since increased the max size for the Application log.</p>
  <h3>Machine configuration:</h3>
  <ul>
  <li>OS: Windows 2008 R2 Standard SP1 (x64)</li>
  <li>SQL: Microsoft SQL Server 2005 - 9.00.4035.00 (Intel X86)   Nov 24 2008 13:01:59   Copyright (c) 1988-2005 Microsoft Corporation  Standard Edition on Windows NT 6.1 (Build 7601: Service Pack 1)</li>
  <li>CPU: Intel Xeon E5430 @ 2.66GHz</li>
  <li>RAM: 32 GB</li>
  <li>Paging file: 32 GB on drive E (System managed), None on all other drives (including drive C)</li>
  </ul>
  <h3>More info:</h3>
  <ul>
  <li>The server has 2 databases that are actively used:</li>
  <li>One database is used for replication (1 Publication with about 450 subscribers, most of which synchronize daily, usually more than once per day). The same database is also used by a web application that has about 150 subscribers that use it actively during the day.</li>
  <li>Both of the databases also have frequent jobs running that mainly do file imports and transfers from one db to the other.</li>
  </ul>
  <h3>Update:</h3>
  <p>While checking the logs once again, I've noticed that the AppDomain gets marked for unload due to memory pressure, unloaded and recreated at a rate of about once every 30 minutes. During the last 2 occurences of the stated problem, the AppDomain went up to 250 and 264, respectively. Could this be a related issue?</p>