【问题标题】:How do I find the size of MemoryCache, preferrably programatically?如何找到 MemoryCache 的大小,最好以编程方式?
【发布时间】:2012-11-23 08:48:09
【问题描述】:

我想找到MemoryCache 的大小。

MemoryCache _cache = MemoryCache.Default;
_cache.Add("key", "value");
FindSize(_cache);

我想实现FindSize() 方法。

【问题讨论】:

标签: c# memorycache


【解决方案1】:

恐怕您在运行时找不到 .NET 对象的大小。有关详细信息,请参阅这些答案:

【讨论】:

    【解决方案2】:

    您需要_cache.Count() 值还是其他值?

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-06-14
      • 1970-01-01
      • 1970-01-01
      • 2021-04-09
      • 1970-01-01
      • 2019-03-31
      相关资源
      最近更新 更多