Hosting and Memory Errors
If you are running your Sitefinity site on a shared hosting provider you may come across a troublesome error indicating that the available memory space is under 5% and your service can not be activated. This is a defensive measure by ASP.NET to help keep your system stable but what can you do about it?
When running your site on shared hosting it will often be on a large platform. Some 16 Core, 50GB memory system or an array of them. The options today of virtual servers and platforms provides a lot of options. Depending on the platform and how it communicates free memory back to your running app may vary but lets consider somethings first.
5% of 50GB is still plenty of space to fire your web service.
Its up to the hosting provider to monitor and manage memory of yours and and every other application running in that shared environment.
Most likely the site will be running but when you log into the back end you won't be able to access the list of pages or edit content. You will get an error along the lines of:
Memory gates checking failed because the free memory (xxxxx bytes) is less than 5% of total memory. As a result, the service will not be available for incoming requests.
Sitefinity is making lots of WCF calls here and the error is raised because of them. You may or may not get a decent message. Firefox pops up and displays it clear as but other browsers function different and you may want to check your network and console logs to confirm that this is the actual problem you are dealing with.
Solution - Sort of
If you are getting this message then there is something you can do. You can configure at what point this message is displayed or turn it off and have the system run the service call anyway.
Find the element serviceHostingEnvironment and set the attribute minFreeMemoryPercentageToActivateService to '0' to ignore\stop the memory check. (I haven't looked up which one it actually does.)
This will take care of your problem.
Of course, if you get this message on your own servers you need to look at getting more memory or reducing the load. Implementing this just masks the problem. If you run out of memory your site will have more troubles.
I hope it helps you out.
Thanks for reading and feel free to comment - Darrin Robertson