开发者

How to determine the size of an ASP.net Cache Item?

开发者 https://www.devze.com 2022-12-11 18:56 出处:网络
I know that its possible to get the total size of the ASP.net Cache(How to determine total size of ASP.Net cache?)

I know that its possible to get the total size of the ASP.net Cache (How to determine total size of ASP.Net cache?)

But is it possible to break down the that total into the开发者_如何学C individual items stored in cache?

Thanks for your help!


If you just need a one off report then you can serialize each object that is returned and count the bytes.

 Dim Stream As New IO.MemoryStream
 Dim FM As New LosFormatter
 FM.Serialize(Stream, Myobject)
 dim O as object = Stream.ToArray
 Trace.Write(O.length) 'The size of the object that you want to measure
0

精彩评论

暂无评论...
验证码 换一张
取 消