If one of the web apps you're running, which are the worker processes, is eating up memory then that is something the app needs to fix. You can use a tool like Process Explorer to figure out which app is actually using up the memory and where it is using the memory. From there you can use standard web debugging to see more details that are specific to the app.
If you need quick mitigation such that one bad app doesn't eat up all the memory on your server then you have a couple of options. The best option would be to change the app pool settings for that process.
- Open IIS Manager and go to the app pools.
- Right click the app pool hosting the bad worker process and select
Advanced Settings
. - Under
Recycling
set the limit for how much memory can be allocated (generally virtual) before the app pool recycles. You'll want to ensure you configure the logging to show these events so you can more easily track them.
If you set a recycling limit then when memory gets to that limit new requests will trigger a new worker process and once the old process has handled all its outstanding requests it'll get shut down. This is best for processes that are either leaking memory or failing to release memory fast enough.
If the process just keeps allocating memory while handling requests then setting a limit won't help most likely. In that case you may need to switch the app to x86 mode (General \ Enable 32-bit Applications
) temporarily. This will put a fixed limit of 2GB on the process. Any attempts to exceed that cause an error that brings down the process. For this to work your web app will need to support running in x86 mode (many do provided they don't rely on native components) and this will likely result in more errors seen by the end user. But as a quick and dirty solution until the problem can get resolved this may be good enough.
I would start with limiting memory and see if that fixes the problem until the real issue can get resolved and escalate to x86 only if necessary.