34

最終的にこのエラーを解決するにはどうすればよいですか?


'/****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.

ソース エラー:

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.

スタックトレース:

[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

バージョン情報: Microsoft .NET Framework バージョン:4.0.30319; ASP.NET バージョン:4.0.30319.17929

4

8 に答える 8

105

解決策はあなたの投稿に書かれています。

これを解決するには、マシンの負荷を減らすか、serviceHostingEnvironment 構成要素の minFreeMemoryPercentageToActivateService の値を調整します。

これを web.config に追加するだけの最も簡単な方法

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

詳しくはserviceHostingEnvironment こちらをご覧ください。

とにかく、@Mr Grokが正しく指摘した方法は、マシンに十分な物理メモリがないことを示しており、なぜこれが起こっているのかを理解する必要があります. 深刻な問題になる可能性があります。

于 2013-07-03T13:51:47.940 に答える
6

この問題がありました。SQL サーバーは、利用可能な 32 GB のうち 29 GB 以上を使用していたことが判明しました。

ある場合は、SQL Server を確認してください。MS SQL Sever は、可能な限り多くの空き領域を占有するように設計されています。これは、SQL Server のプロパティ タブにある最大サーバー メモリ ボックスで制限できます。

于 2015-02-03T22:16:54.287 に答える
1

web.config で serviceHostingEnvironment 属性を 0 に追加しました。

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

これは、これを行うために私が見つけた最も簡単な方法です。

于 2017-10-17T10:10:09.133 に答える