Possible Duplicate:
How to find out size of session in ASP.NET from web application?
Hi,
Is there any way to know the memory size occupied by session variables in asp.net application?
Thanks, P.Gopalakrishnan.
Possible Duplicate:
How to find out size of session in ASP.NET from web application?
Hi,
Is there any way to know the memory size occupied by session variables in asp.net application?
Thanks, P.Gopalakrishnan.
(marked wiki re duplicate; I was going to delete, but some things may be useful)
It will vary on the provider; for the in-memory state provider, you way as well ask "how big is an object/graph" - and the answer is... tricky at best. However, there are other providers, that typically use BinaryFormatter
to serialize the data to a database etc. And it is then relatively easy to measure - either as part of your real system, or by just running it through BinaryFormatter
yourself.
However, the real question is: are you seeing a problem? Sometimes, using a non-trivial amount of memory is fine and normal. Of course, relying on in-memory session (when IIS does app-pool recycling regularly) may be inadvisable...