Подтвердить что ты не робот

Ошибка IIS Server из-за текущей общей памяти

Как решить эту ошибку в конечном итоге?


Ошибка сервера в приложении "/**** 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

4b9b3361

Ответ 1

Решение написано в вашем сообщении.

Чтобы решить эту проблему, уменьшите нагрузку на машину или настройте значение minFreeMemoryPercentageToActivateService на serviceHostingEnvironment.

Самый простой способ просто добавить это в свой web.config

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

Подробнее о serviceHostingEnvironment здесь.

В любом случае, как правильно указал @Mr Grok, это указывает на то, что на вашем компьютере недостаточно физической памяти, и вы должны выяснить, почему это происходит. Это может быть серьезной проблемой.

Ответ 2

У меня была эта проблема. Оказывается, SQL-сервер использовал более 29 gb моих доступных 32 gb.

Проверьте свой SQL Server, если он у вас есть. MS SQL Sever предназначен для использования на столько свободного места, сколько вы его позволяете. Вы можете ограничить это в поле максимальной памяти сервера на вкладках свойств SQL Server.

Ответ 3

Я добавил атрибут serviceHostingEnvironment в 0 в web.config.

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

Это самый мощный способ сделать это.

Ответ 4

Ну, у меня была та же проблема, и я искал решение. Большинство блогов предлагали одно и то же решение для добавления атрибута "serviceHostingEnvironment" в web.config, что является рискованной работой, так как добавление атрибута повлияет на весь IIS, а также на размещенные решения и в конечном итоге перезапустит IIS.

Поскольку сообщение об ошибке было связано с "проблемой хранения памяти", и нас попросили уменьшить нагрузку на сервер, я просто перезапустил службу SQL Server (MSSQLSERVER) через диспетчер служб, и все вернулось в норму, и я избавился от проблема с памятью.

Window + R> services.msc> Перезагрузка ниже выделенного сервиса

enter image description here

Ответ 5

У меня работал web.config, но проблема с памятью SQL Server была проблемой, которую нужно было решить.

Мне удалось решить проблему с памятью сервера sql, не перезапуская процессы сервера MSSQL, просто сократив память сервера свойств. Максимальная память сервера снизилась до значения. Дефолт был практически неограниченным.

Без перезапуска службы MS SQL процесс автоматически начал сокращать объем памяти до настроенного значения.
Screenshot of server properties

Ответ 6

Я попытался установить minFreeMemoryPercentageToActivateService = "0" в файлах web.config, но в моем случае это не помогло. Я использую VMWare, и он работает очень медленно, потому что у меня слишком много снимков! Я удалил старые, очистил место на диске и перезапустил сервер, и все ошибки были устранены.

Я новичок в VMWare и SharePoint, подумал, что могу поделиться своим опытом здесь!

Ответ 7

Необходимо перезапустить IIS с помощью утилиты командной строки IISReset. В меню "Пуск" выберите пункт "Выполнить".

В поле Открыть введите cmd и нажмите ОК.

В командной строке введите: iisreset/noforce

IIS пытается остановить все службы перед перезапуском. Утилита командной строки IISReset ожидает до одной минуты остановки всех служб.