HttpContext.Cache物理内存使用率 [英] HttpContext.Cache Physical Memory Usage

查看:251
本文介绍了HttpContext.Cache物理内存使用率的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法找到当前在HttpContext.Cache?

Is there any way to find the number of bytes of memory that are currently in the HttpContext.Cache?

我发现在那里你可以得到使用EffectivePrivateBytesLimit或EffectivePercentagePhysicalMemoryLimit物理内存的限制,但我有发现当前物理内存使用率的困难。

I've found where you can get the physical memory limit using EffectivePrivateBytesLimit or EffectivePercentagePhysicalMemoryLimit, but I'm having difficulties finding the current physical memory usage.

任何想法?

--- ---更新

AFER一些更多搜索和使用所述第一响应提 http://aspalliance.com/cachemanager/ 的我去的那页,在底部还有就是 HTTP链接://www.codeproject.com / ASPNET / exploresessionandcache.asp 描述来计算对象的大小,我认为就可以了使用的方法。

Afer some more searching and using the first response mentioning http://aspalliance.com/cachemanager/ i went to that page, at the bottom there is a link to http://www.codeproject.com/aspnet/exploresessionandcache.asp that describes a method to calculate the size of an object that i think will be good enough to use.

基本上其序列在高速缓存的每个对象则它然后查找序列化流的长度。总结这些价值观导致了一些资料,我可以使用。

Basically it serializes each object in the cache then it then finds the length of the serialized stream. Summing these values results in some information i can use.

推荐答案

有一个第三方的缓存管理器,它提供的工具和统计信息的高速缓存的httpRuntime。你可以有手动获取内存信息,或者您也可以使用反射到组件内偷看看看它是如何收集统计数据,并自己动手在你的应用程序

There is a third-party "Cache Manager" which provides tools and stats for the HttpRuntime cache. You can get memory info there manually, or you can use Reflector to peek inside the assembly and see how it collects the stats, and do it yourself in your app

这篇关于HttpContext.Cache物理内存使用率的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆