I have a C # service that is not an ASP.NET application but uses a singleton instance of the HttpRuntime class to cache elements in a cache element. Singleton is created as follows:
static private System.Web.HttpRuntime _httpRuntime = new HttpRuntime();
I want to set the maximum memory usage, so I have the following application configuration file: service.exe.config:
<configuration>
<caching>
<cache privateBytesLimit= "50000000" privateBytesPollTime = "00:01:00"/>
</caching>
</configuration>
This has no effect. Instead of setting it to 50 MB, when I look in HttpRuntime.Cache.EffectivePrivateBytesLimit, it is 720 MB.
What am I doing wrong?
source
share