WCF 記憶體入口檢查失敗 Memory gates checking failed,wcfchecking
在做JC系統時,出現這樣的錯誤:
英文報錯:Memory gates checking failed because the free memory ({0} 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服務啟用之前,系統應該具有的最小記憶體量不足config檔案中設定的百分比。我是在本機調試的時候出現的。
解決方案: 關閉其他不用的程式,釋放記憶體。或者更改用戶端webconfig中 system.serviceModel–> serviceHostingEnvironment–>
minFreeMemoryPercentageToActivateService=1屬性值為小一些,或者為0。 如下代碼所示:
<system.serviceModel> <behaviors> <serviceBehaviors> <behavior name=""> <serviceMetadata httpGetEnabled="true"/> <serviceDebug includeExceptionDetailInFaults="true"/> </behavior> </serviceBehaviors> </behaviors> <serviceHo1tingEnvironment multipleSiteBindingsEnabled="true" <span style="color:#ff0000;">minFreeMemoryPercentageToActivateService=0</span>/> <bindings> <basicHttpBinding>