Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/multithreading/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 对WCF服务的多个异步调用上的System.OutOfMemoryException_C#_Multithreading_Wcf_Asynchronous - Fatal编程技术网

C# 对WCF服务的多个异步调用上的System.OutOfMemoryException

C# 对WCF服务的多个异步调用上的System.OutOfMemoryException,c#,multithreading,wcf,asynchronous,C#,Multithreading,Wcf,Asynchronous,我有一个windows服务,它同时执行对WCF服务的多个异步调用(使用Parallel.Foreach循环) WCF服务正在生成多个System.OutOfMemory异常 我需要配置什么才能成功运行多线程?据我所知,IIS管理线程资源。。我相信我的理解是错误的 任何帮助都将不胜感激。将其添加到您的web.config: <bindings> <basicHttpBinding> <binding maxBufferPoolSize="214748364

我有一个windows服务,它同时执行对WCF服务的多个异步调用(使用Parallel.Foreach循环)

WCF服务正在生成多个System.OutOfMemory异常

我需要配置什么才能成功运行多线程?据我所知,IIS管理线程资源。。我相信我的理解是错误的


任何帮助都将不胜感激。

将其添加到您的web.config:

<bindings>
  <basicHttpBinding>
    <binding maxBufferPoolSize="2147483647" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647" messageEncoding="Text">
      <readerQuotas maxDepth="2000000" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
    </binding>
  </basicHttpBinding>
</bindings>


每次呼叫服务时都要进行哪些工作?减少呼叫次数。我怎么也不认为你还能做什么。如果一次呼叫导致内存不足怎么办?一次呼叫是否完成?你的WCF是做什么的?有代码吗?还显示服务器代码。代码中有一个缺陷导致内存使用过多。许多并行调用通过边缘发送资源使用情况。如果没有看到有缺陷的代码,就无法回答此问题。暂时关闭这个。