由于当前的总内存,IIS服务器错误

Sun*_*ang 32 memory iis

如何最终解决这个错误?


'/****StatWCF_OData'应用程序中的服务器错误.

Memory gates checking failed because the free memory (373817344 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.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.InsufficientMemoryException: Memory gates checking failed because the free memory (373817344 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.
Run Code Online (Sandbox Code Playgroud)

来源错误:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Run Code Online (Sandbox Code Playgroud)

堆栈跟踪:

[InsufficientMemoryException: Memory gates checking failed because the free memory (373817344 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.]
   System.ServiceModel.Activation.ServiceMemoryGates.Check(Int32 minFreeMemoryPercentage, Boolean throwOnLowMemory, UInt64& availableMemoryBytes) +121924
   System.ServiceModel.HostingManager.CheckMemoryCloseIdleServices(EventTraceActivity eventTraceActivity) +86
   System.ServiceModel.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath, EventTraceActivity eventTraceActivity) +883

[ServiceActivationException: The service '/****StatWCF_OData/OData.svc' cannot be activated due to an exception during compilation.  The exception message is: Memory gates checking failed because the free memory (373817344 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..]
   System.Runtime.AsyncResult.End(IAsyncResult result) +650220
   System.ServiceModel.Activation.HostedHttpRequestAsyncResult.End(IAsyncResult result) +210733
   System.Web.CallHandlerExecutionStep.OnAsyncHandlerCompletion(IAsyncResult ar) +282
Run Code Online (Sandbox Code Playgroud)

版本信息:Microsoft .NET Framework版本:4.0.30319; ASP.NET版本:4.0.30319.17929

Mil*_*jka 99

解决方案写在您的帖子中.

要解决此问题,请减少计算机上的负载或调整serviceHostingEnvironment配置元素上的minFreeMemoryPercentageToActivateService的值.

最简单的方法就是将其添加到web.config中

<system.serviceModel> 
    <serviceHostingEnvironment minFreeMemoryPercentageToActivateService="0" />
</system.serviceModel> 
Run Code Online (Sandbox Code Playgroud)

了解更多关于serviceHostingEnvironment 这里.

无论如何@Mr Grok正确地指出它表明你的机器没有足够的物理内存,你应该弄清楚为什么会发生这种情况.这可能是一个严重的问题.

  • 虽然这是最简单的,但值得注意的是,如果您的服务器资源不足,这个错误可能表明您的机器上没有足够的物理内存,因此您可能接近手上有更大的问题.检查资源监视器/任务管理器以查看正在使用的内存量是非常值得的. (10认同)
  • 想知道为什么不是〜2%而不是0%?使用0%时,它是否会将服务器上的每个进程(可能是关键的)置于失败的alloc(可能是未处理的)的危险中?哦"免费内存"不包括虚拟(查看任务管理器显示free = 0 with commit = 8/13)?谁能确认一下? (2认同)

小智 5

我有这个问题.事实证明,SQL服务器使用的是超过29 gb的32 gb.

检查您的SQL Server(如果有).MS SQL Sever旨在占用尽可能多的可用空间.您可以在SQL Server的属性选项卡中的最大服务器内存框中对此进行限制.