I have a C# service which is not an ASP.NET application, but uses a singleton instance of of class HttpRuntime to cache items in its cache member. The singleton is created like this:
static private System.Web.HttpRuntime _httpRuntime = new HttpRuntime();
I want to set its maximum memory usage so I have the following in the app's config file service.exe.config:
<configuration>
<caching>
<cache privateBytesLimit= "50000000" privateBytesPollTime = "00:01:00"/>
</caching>
</configuration>
This doesn't seem to have any effect. Instead of setting it to 50MB, when I look in HttpRuntime.Cache.EffectivePrivateBytesLimit it is 720 MB.
What am I doing wrong?