We recently had a ASP.NET web application (running in a 32-bit application pool), which was running well for years without problems, fill its log with OutOfMemoryExceptions. Recycling the application pool fixed the issue.
I am aware the the correct long-term solution is to
- find, identify and fix any memory leaks, and
- migrate the application to 64 bit and provide more memory, if needed.
Until that is done, I want to at least keep the service available. Fortunately, application pools in IIS conveniently allow me to configure a "Private Memory Limit (KB)" and a "Virtual Memory Limit (KB)", which cause the application pool to be recycled automatically, once those limits are reached.
I want to set those options to values which are
- as high as possible, to avoid unnecessary application pool recycle operations, but
- as low as necessary to prevent OutOfMemoryExceptions.
Since 32-bit applications can use at most 2GB of virtual memory, I'd ... just set both options to slightly below 2GB? Is it really that simple or am I missing something?