I\'m trying to figure out the size of a particular session state. On one of our heavy pages (lots of data in a table) it gets progressively slower. The issue is resolved by
Measure it:
int totalBytes;
var formatter = new BinaryFormatter();
for(int i = 0; i < Session.Count; i++)
{
using (var stream = new MemoryStream())
{
formatter.Serialize(stream, Session[i]);
stream.Flush();
totalBytes += stream.Length;
}
}
Also I believe that if you enable tracing it will show you some details about the session (not sure about this, never tried it myself).