Troubleshooting the "Memory gates checking failed because the free memory (x bytes) is less than 5% of total memory." error
Who is this article for?Users who encounter the error.
IT Administrator permissions are required to resolve the issue.
When using the system you might encounter an error message similar to "The requested service (...) could not be activated", with the underlying error "Memory gates checking failed because the free memory (x bytes) is less than 5% of total memory.".
This article explains what causes the issue and how to resolve it.
1. Issue
When you connect to the application service using the desktop app or App Manager, if the main service is sleeping then it will wake up.
Windows checks how much server memory is free, and if it is less than 5% of the server's total memory, an error message will be generated, and the service will not be started.
This is to protect the server's overall performance.
If this happens when you are using the desktop application or App Manager, you will see a "An error occurred attempting to connect to the remote service." message.
The error message may refer to TngService.svc OR TngFileService.svc.
This can happen when starting the application, or it can happen during normal use if you attempt to attach or download a file.
To see the full message, browse to the service in any browser.
You will also find this error in Windows Event Viewer.
The full error text, "Memory gates checking failed because the free memory (x 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." suggests to reduce the load on the server, which is likely to be not practical.
2. Solution
To resolve the issue if this error appears regularly, we recommend increasing the amount of RAM assigned to the application server.
The alternative suggestion is to adjust minFreeMemoryPercentageToActivateService, so that Windows can start the service with a smaller amount of free memory.
In practice this is not advised, because the service needs memory to run. If there is only a small amount available then performance will suffer.