views:

63

answers:

1

I know that its possible to get the total size of the ASP.net Cache (http://stackoverflow.com/questions/344210/how-to-determine-total-size-of-asp-net-cache)

But is it possible to break down the that total into the individual items stored in cache?

Thanks for your help!

A: 

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
Middletone