see inline >>>
"Frank" <ex*************@aol.com> wrote in message
news:A0**********************************@microsof t.com...
Our system maintains session state using the ASP.NET State Server service.
We expect some of our session state objects to be over 85K, which
categorizes them to be VLO's (very large objects) in terms of .NET memory
allocations. This means that these objects will be allocated in a special
managed heap for large objects. This makes sense since this would require
some work for the garbage collector to move and compact these objects during
a GC (garbage collection). Regardless, this means that these objects will
eventually be placed in generation 2 of the directed graph of objects that
the GC maintains.
My questions are the following:
1) When do objects contained within the state server get garbage collected?
When the session "ends"?
a) If this is true, what event triggers the state server to tell it
the session has ended?
session timeout based on last access (this timeout is set in
web.config). when the timeout happens, any session objects are released, and
thus availiable for GC.
2) Can I say that the objects will be ready for collection when I call
Session.Abandon()? I heard that Session.Abandon() only signals the end of a
Session for in-proc mode. Is this true?
yes. for non inproc, the session objects are created on page init, by
reserializing from the store. at the end of the page request, the session
objects are seialized to the store and released, ready for GC
3) Does the fact that our objects are allocated on a separate "special"
heap for very large objects influence how they are garbage collected?
somewhat, but don't worry. GC's normally create different heaps for
different object sizes to prevent fragmentation of the heap. normally you
would not GC a heap, until you needed the space. as the the number of large
allocation requests is smaller than the number of small allocation
requests, the smaller heaps are GC'd more often.
Thanks,
Frank