[英]Opening large Images using BitmapImage.SetSource - Insufficient Memory Exception
[英]Insufficient Memory Exception in WCF Large File Uploading
我正在尝试使用WCF上传大文件(> 10GB)。 服务Web.config如下
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding" maxBufferPoolSize="2147483647000000" maxReceivedMessageSize="2147483647000000" transferMode="Streamed">
<readerQuotas maxDepth="200000000" maxStringContentLength="2147483647"
maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
</binding>
</basicHttpBinding>
</bindings>
<client>
<endpoint address="http://localhost:42890/Service1.svc" behaviorConfiguration="endpointBehavior"
binding="basicHttpBinding"
contract="UploadFileService.IService1" name="BasicHttpBinding" />
</client>
和客户端的web.config如下
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding" closeTimeout="10:00:00" openTimeout="10:00:00"
receiveTimeout="10:00:00" sendTimeout="10:00:00" maxBufferPoolSize="2147483647000000"
maxReceivedMessageSize="2147483647000000" />
</basicHttpBinding>
</bindings>
运行代码时,内存不足异常,如何解决?
在您的解决方案中,目标x64而不是任何CPU。 这将允许更多的内存分配。
但是,根据您的解决方案,您也许可以将文件Stream
传输到磁盘,而不需要使用太多内存。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.