I was running an application using Visual Studio and for not so apparent reason the web service was not working. Since I was debugging the web site connecting to a web service within visual studio - it was not apparent as to why it was failing. When I started debugging the web service, I figured it resulting in an error - Memory gates checking failed because the free memory (296964096 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..
That's interesting as I didn't know the web service would not start if the computer is running low on memory. So, in my case, I stopped certain programs to free up memory before re-running the application and this time it ran fine. So, what could I have done differently. I could have modified minFreeMemoryPercentageToActivateService within serviceHostingEnvironment config element and reduce the minimum memory required to run the program as show below.