WCF Sync Framework Existing connection was forcibly closed by the remote host
<p><strong>Update</strong> This appears to be caused by the server running out of physical memory.</p>

<p>I am using WCF sync framework to upload ~200,000 records to a database. By using SQL Server Profiler, I was able to verify that the web server received the records and started writing them to the database. After writing about ~60,000 records, the web server throws an exception. In one attempt, the exception was thrown after 7 minutes; in another attempt, the exception was thrown after 9 minutes. Stack trace.</p>

<pre><code>System.ServiceModel.CommunicationException: An error occurred while receiving the HTTP response to https://ecosystems.icfwebservices.com/Services/EDT/DataCacheSync.svc. This could be due to the service endpoint binding not using the HTTP protocol. This could also be due to an HTTP request context being aborted by the server (possibly due to the service shutting down). See server logs for more details.
---&gt; System.Net.WebException: The underlying connection was closed: An unexpected error occurred on a receive.
---&gt; System.IO.IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host.
---&gt; System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host
at System.Net.Sockets.Socket.Receive(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags)
at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
--- End of inner exception stack trace ---
at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
at System.Net.FixedSizeReader.ReadPacket(Byte[] buffer, Int32 offset, Int32 count)
at System.Net.Security._SslStream.StartFrameHeader(Byte[] buffer, Int32 offset, Int32 count, AsyncProtocolRequest asyncRequest)
at System.Net.Security._SslStream.StartReading(Byte[] buffer, Int32 offset, Int32 count, AsyncProtocolRequest asyncRequest)
at System.Net.Security._SslStream.ProcessRead(Byte[] buffer, Int32 offset, Int32 count, AsyncProtocolRequest asyncRequest)
at System.Net.TlsStream.Read(Byte[] buffer, Int32 offset, Int32 size)
at System.Net.Connection.SyncRead(HttpWebRequest request, Boolean userRetrievedStream, Boolean probeRead)
--- End of inner exception stack trace ---
at System.Net.HttpWebRequest.GetResponse()
at System.ServiceModel.Channels.HttpChannelFactory`1.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout)
--- End of inner exception stack trace ---

Server stack trace: 
at System.ServiceModel.Channels.HttpChannelUtilities.ProcessGetResponseWebException(WebException webException, HttpWebRequest request, HttpAbortReason abortReason)
at System.ServiceModel.Channels.HttpChannelFactory`1.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout)
at System.ServiceModel.Channels.RequestChannel.Request(Message message, TimeSpan timeout)
at System.ServiceModel.Dispatcher.RequestChannelBinder.Request(Message message, TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)
</code></pre>

<p>I have several web.config settings in place that are intended to prevent a timeout from occurring.</p>

<pre><code>&lt;configuration&gt;
  &lt;system.web&gt;
    &lt;compilation debug="false" targetFramework="4.0"&gt;&lt;/compilation&gt;
    &lt;httpRuntime executionTimeout="100000" /&gt;
  &lt;/system.web&gt;
&lt;/configuration&gt;
</code></pre>