title: How to find out size of ASP.NET session, when there are non-serializable objects in it?
body: <p>I have a feeling that I'm putting rather much data in my ASP.NET session, but I've no idea how much and if I should be concerned. I found a <a href="https://stackoverflow.com/questions/198082/how-to-find-out-size-of-session-in-aspnet-from-web-application">similar question</a>, but that relies on serializing objects and checking their serialized size. In my case the majority of data in the session is in objects from another library which doesn't have its classes marked as "Serializable". (I know that this restricts me to using InProc session state provider, but that's another issue). Does anyone have an idea on how to traverse the object graph and find out its size?</p>
  
  <p><strong>Added:</strong> OK, one way would be a manual traversal of the object graph and usage of Marshal.SizeOf() method. But that's a lot of writing to get that working. Is there perhaps a simpler way of achieving the same effect? I'm not aiming for byte precision, I'm interested in the order of magnitude (kilobytes, megabytes, tens of megabytes...)</p>