I am building an asp.net application, using II6 on windows server 2003 (vps hosting).
I am confronted with an error I didn’t receive on my development machine (windows 7, iis 7.5, 64 bit).
When my wcf service tries launching my query running against a local sql server this is the error I receive:
Memory gates checking failed because
the free memory (43732992 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.
and ideas??
Answers:
Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.
Method 1
In your web.config, in your configurationsystem.serviceModelserviceHostingEnvironment element, add a minFreeMemoryPercentageToActivateService attribute, and set it to something lower than 5, I set mine to 0, and this error went away for me.
ex:
<configuration>
<system.serviceModel>
<serviceHostingEnvironment ... minFreeMemoryPercentageToActivateService="0" />
</system.serviceModel>
</configuration>
Caution via MSDN: “Specifying this attribute along with partial trust in the web.config file of a WCF service will result in a SecurityException when the service is run.”
Method 2
One thing you could try is changing your ‘mex’ service path to absolute if it is not already. It worked for me once. But that could have been due to the service restarting and freeing some memory.
BrainSlug’s Answer has an example of how to do this
Method 3
I encountered this issue when I was running my WCF service locally (localhost). I stopped the service. Closed few apps to clean my ram. and restarted it again. It started normally as earlier.
BrainSlug’s Answer also worked. +1 for that. 🙂
Cheers!!
All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0