微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

asp.net – 具有完全内存错误的WCF服务(内存门检查失败,因为可用内存) – 如何解决

我有一个WCF服务主机。我的请求来自wc很高。我的主持人,经过一段时间的展示,记忆力充沛。这个问题重复。当我打开Web Service帮助页面时,会显示错误

Memory gates checking Failed because the free memory (1398493184
bytes) is less than 5% of total memory. As a result,the service will
not be available for incoming requests. To resolve this,either reduce
the load on the machine or adjust the value of
minFreeMemoryPercentagetoActivateService on the
serviceHostingEnvironment config element.

我的WCF主机的web.config如下:

<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior name="">
  <serviceMetadata httpGetEnable="true"/>
  <serviceDebug includeExceptionDetailInFaults="false"/>
  <serviceHostingEnvironment minFreeMemoryPercentagetoActivateService="1"/>
</behavior>
</serviceBehaviors>

和主机web.config

<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_IPaperService" clouseTimeout="00:10:00" openTimeout="00:10:00" receiveTimeout="00:10:00" sendTimeout="00:10:00" allowCookies="false" bypassproxyOnLocal="false" hostNameComparisojnMode="StringWildcard" maxBufferSize="1000000000" maxBufferPoolSize="1000000000" maxReceivedMessageSize="100000000" messageEncoding="text" textEncoding="utf-8" transferMode="Buffered" useDefaultWebProxy="true">
<readerQuotas maxDepth="32" maxStringContentLength="1000000000" maxArrayLength="1000000000" maxBytesPerRead="4096" maxNaMetableCharCount="16384" />
  <security mode="None">
  <transport clientCredentialType="None" proxyCredentialType="None" realm=""/>
  <message clientCredentialType="UserName" algorthmSuite="Default" />
  <security>
</binding>

我如何解决我的问题?

解决方法

请尝试在wCF主机的yourweb.config中将minFreeMemoryPercentagetoActivateService设置为0,如 this answer所示

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐