我有一个WCF服务主机.我对厕所的要求很高.我的主人,过了一段时间出现了内存满的问题.这个问题反复出现.当我打开Web服务帮助页时,显示以下错误:

内存门判断失败,因为可用内存(1398493184

我的网络.WCF主机的配置如下:

<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>

我怎样才能解决我的问题?

推荐答案

try 按照this answer中的建议,在WCF主机的web.config中将minFreeMemoryPercentageToActivateService设置为0

<system.serviceModel>
    <serviceHostingEnvironment minFreeMemoryPercentageToActivateService="0"/>
</system.serviceModel>

编辑1:这提供了一种解决方法,但没有解决根本原因.这取决于你的具体情况,可能不够好,也可能不够好.

编辑2:正如@radderz在 comments 中正确指出的,"serviceHostingEnvironment"元素需要是"system.serviceModel"的子元素,请参见MSDN documentation

Asp.net相关问答推荐

无法为媒体类型application/x-www-form-urlencoded生成样本

System.Web.Helpers.Crypto - 盐在哪里?

我可以根据角色隐藏/显示 asp:Menu 项吗?

如何计算/查找给定日期的周数?

无法从 App_code 文件夹中找到类型或命名空间

如何通过后面的代码不显示

在使用网络服务器加载它们之前,如何编译 Asp.Net Aspx 页面?

尽管安装了 AspNetCoreModule,但在 IIS 中运行 ASP.NET Core 应用程序时出现 0x8007000d 错误 500.19

如何在新实现的接口或基类之间做出决定?

如何获取当前登录用户的角色列表

ASP.NET web.config:system.web.compilation 中的 debug 属性的默认值是什么?

为什么 HttpWebRequest 会抛出异常而不是返回 HttpStatusCode.NotFound?

头标记中的内联代码 - ASP.NET

在 Visual Studio 2010 中随机禁用编辑 aspx/ascx 文件?

IIS - 无法通过 ip 地址而不是 localhost 访问页面

盒式磁带包与 MVC4 包

DateTime.Parse 和 Convert.ToDateTime 之间有什么区别?

为什么 C# 对于 CSC 文件会遇到此错误?

x-powered by是什么意思?

如何使用 WebAPI 处理图像