The cause for getting the above error is free memory is less to start this service. So you need to free some memory.
“Memory gates checking failed because the free memory 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.”
You can resolve this issue by restarting the SPSearchHostController service in services.msc console as this consumes lot of memory, which will free some memory for you. You can also try to reboot your server or close unnecessary applications to free some memory.
more :http://social.technet.microsoft.com/wiki/contents/articles/25793.step-by-step-guide-to-configure-environment-for-creating-your-first-sharepoint-hosted-app.aspx