I have a Windows Server 2008 webserver with two web applications and two windows services. It is essential that the server never uses more than 2 GB of memory and the server can have no pagefile. What is the best approach to accomplish this?
I am considering writing an extra Windows Service to monitor the other processes and restart the two w3wp.exe processes and the two Windows services whenever needed. However, I am hoping for a better and more robust solution.
I know I can limit the w3wp.exe processes by recycling the application pools based on memory consumption, but that doesn't solve the problem entirely because the two windows services could spend all memory on their own. I've already tried limiting them each to 300 MB but they still occasionally exceed 2 GB RAM usage.
Rewriting the applications involved are not options.