I’m running a ASP.NET application on Win2003 32bit that tends to allocate a lot of memory. To avoid OutOfMemoryExceptions that start to appear when the W3P process exceeds 1 GB, I have set a maximum virtual memory limit of 850 MB for the this application pool, so the application will restart instead of throwing exceptions.
While not throwing exceptions, these restarts still lead to temporal performance degeneration (low cache hit ratio, aspx compiling etc.), so I’d like to minimize the number of restarts. Watching the performance counters I can see that the ASP.NET cache works as designed (item count and cache hit ratio increasing after start, after I while some items get removed probably due to expiration dates), except for cache trimmings.
E. g. I would expect cache trimming to kick in when e. g. 750 MB are in use and half of that is cache. But it never happens, under load it continues to allocate more and more memory instead of e. g. trashing low prio cache items, until it hits the memory limit.
Does anybody know what would actually trigger cache trimming? Available physical memory? Is there any other setting available to optimize this scenario?
(Yes, I know, 32 bit is so 2004 and with x64 this problem would go away, probably even with the same amount of memory, but for this app I’m stuck with this server for another few months and have to keep it up running...)