Service cannot be activated ... free memory < 5%

This may have come up in another thread so wanted to copy and paste from a KB discussion made when E10 started rolling out.

The issue you may see as an Admin over E10 is:
The service ‘[ShareName][ServiceName]svc’ cannot be activated due to an exception during compilation. The exception message is: Memory gates checking failed because the free memory ([#]bytes) is less than 5% of total memory.

This occurs as a protection for the server and is a hot debate among IT admins. I’ll just educate you and you can decide how you want to deploy.

WCF is the communications framework normally used to stand up Ice / ERP services on the server - SalesOrder svc, Tip svc, etc. It maps a url call (e.g.- http://MyServer/ERP10/Ice/BO/Tip.svc) to the Ice.BO.Tip.dll and ‘news’ it up. If WCF does not have 5% of the physical server memory free it throws the exception. This is to prevent the server from being overwhelmed and give everyone a bad experience - including an admin who may need to get on the box and figure out what is sucking up all the memory. It sort of locks out additional clients while the box is being looked at. It is kind of a kick to the admin to look at their box for some care and feeding. Servers needs love too :wink:

The negative on this is that with these newer servers with huge amounts of ram that 5% can be a ridiculous number. Anyone seen a server with 2 Terabytes of ram? That’s 100G free ram and WCF is ignorantly blocking additional calls. Kinds of extreme but its to make a point. You may need to tune that 5% default.

The tuning is done in the web.config by telling wcf to override it’s default protection and set it to something more sane for the box. Find the system.serviceModel element in web.config and set it to something like 1% or whatever makes sense for your box.

< system.serviceModel>
< serviceHostingEnvironment … minFreeMemoryPercentageToActivateService=“1” />
< /system.serviceModel>

Educated > Algorithm

3 Likes

Awesome tip! Thank you Bart.