views:

25

answers:

1

Hello -

I have a question about session variables. We use serializable value objects to store values. Sometimes we're using composite / aggregate objects and I'd like to know how much memory these objects are occupying.

What's a good way to see how big these objects are, so I can see what kind of memory they are using on the server.

Also -

Is there anything to be done with compression and session variables? I didn't know if we could compress them before writing the variable, and uncompress them when retrieving them. Is there any value to this?

Thanks so much. Please let me know if you need more detail.

+1  A: 

There are lots of ways to skin this cat, and I am sure it already has been here, but I would use adplus and Windbg.

As for compression, the sort of good news it sounds like ASP.Net 4.0 has the ability to compress out-of-proc session state. Doesn't help you though. I am sure there is something being done with 3rd party session state providers, but I don't know. Probably doesn't help you either.

I think the relevant question is what are you trying to save and what are you willing to pay for it in the trade-off? In-proc you are trading memory for CPU and the time it takes to un/compress. If it is stored in some kind of session server than the concern must be time on the wire or disk space (which I doubt).

Although you know a lot more about your code than I do I think it is still worth taking a step back and asking if this object is worth saving in state or is the really only a portion of it that is costly or impossible to reconstruct?

Flory
D-Sect