Is there a way to enforce a size limit of MemoryCache in System.Runtime.Caching?

后端 未结 3 1755
囚心锁ツ
囚心锁ツ 2021-02-02 11:32

I\'m using .net 4 Memory Cache. I would like to limit the size of the cache say to 10mb because I don\'t want my application to be abusing what goes in there.

I would al

3条回答
  •  渐次进展
    2021-02-02 11:55

    It seems at this time the maximum amount of memory allocated for the cache can not be enforced. See this post for further reference: MemoryCache does not obey memory limits in configuration

提交回复
热议问题