A
Abi
We able to generate this error in our test environment and were able to
research this enough to understand that the issue is NOT with an abject that
needs to be serialized but rather as the stack trace suggests that the
server (in the web farm) ran out of memory while attempting to stream data
to an ASP Session State database (SQL Server 2000) .
Our test environment consists of:
- 3 web servers Load Balanced
- SQL Server 2000 Database Cluster
- F5 switch (handles the BIG IP)
We were able to simulate this error from 3 clients each opening 6 unique IE
sessions and retrieving the same data (Search) which expects to return 11000
records ... Not to the page tho!
. Each of the Clients encountered the
error in at least 4 sessions.
The workaround is obviously not to return the 11000 records unless
absolutely required, however we do need to find a solution to this. It seems
there are others who have encountered such issues before. I'd like to
understand how they were able to resolve this issue, if at all.
Any suggestions/Solutions will be greatly appreciated.
thanks
Abhinav
Server Error in '/' Application.
--------------------------------------------------------------------------------
Unable to serialize the session state. Please note that non-serializable
objects or MarshalByRef objects are not permitted when session state mode is
'StateServer' or 'SQLServer'.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.
Exception Details: System.Web.HttpException: Unable to serialize the session
state. Please note that non-serializable objects or MarshalByRef objects are
not permitted when session state mode is 'StateServer' or 'SQLServer'.
Source Error:
An unhandled exception was generated during the execution of the
current web request. Information regarding the origin and location of the
exception can be identified using the exception stack trace below.
Stack Trace:
[OutOfMemoryException: Exception of type System.OutOfMemoryException was
thrown.]
[HttpException (0x80004005): Unable to serialize the session state. Please
note that non-serializable objects or MarshalByRef objects are not permitted
when session state mode is 'StateServer' or 'SQLServer'.]
System.Web.Util.AltSerialization.WriteValueToStream(Object value,
BinaryWriter writer) +1710
System.Web.SessionState.SessionDictionary.Serialize(BinaryWriter writer)
+148
System.Web.SessionState.StateClientManager.Serialize(SessionStateItem
item, Stream stream) +146
System.Web.SessionState.SqlStateClientManager.System.Web.SessionState.IStateClientManager.Set(String
id, SessionStateItem item, Boolean inStorage) +126
System.Web.SessionState.SessionStateModule.OnReleaseState(Object source,
EventArgs eventArgs) +464
System.Web.SyncEventExecutionStep.System.Web.HttpApplication+IExecutionStep.Execute()
+60
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&
completedSynchronously) +87
research this enough to understand that the issue is NOT with an abject that
needs to be serialized but rather as the stack trace suggests that the
server (in the web farm) ran out of memory while attempting to stream data
to an ASP Session State database (SQL Server 2000) .
Our test environment consists of:
- 3 web servers Load Balanced
- SQL Server 2000 Database Cluster
- F5 switch (handles the BIG IP)
We were able to simulate this error from 3 clients each opening 6 unique IE
sessions and retrieving the same data (Search) which expects to return 11000
records ... Not to the page tho!

error in at least 4 sessions.
The workaround is obviously not to return the 11000 records unless
absolutely required, however we do need to find a solution to this. It seems
there are others who have encountered such issues before. I'd like to
understand how they were able to resolve this issue, if at all.
Any suggestions/Solutions will be greatly appreciated.
thanks
Abhinav
Server Error in '/' Application.
--------------------------------------------------------------------------------
Unable to serialize the session state. Please note that non-serializable
objects or MarshalByRef objects are not permitted when session state mode is
'StateServer' or 'SQLServer'.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.
Exception Details: System.Web.HttpException: Unable to serialize the session
state. Please note that non-serializable objects or MarshalByRef objects are
not permitted when session state mode is 'StateServer' or 'SQLServer'.
Source Error:
An unhandled exception was generated during the execution of the
current web request. Information regarding the origin and location of the
exception can be identified using the exception stack trace below.
Stack Trace:
[OutOfMemoryException: Exception of type System.OutOfMemoryException was
thrown.]
[HttpException (0x80004005): Unable to serialize the session state. Please
note that non-serializable objects or MarshalByRef objects are not permitted
when session state mode is 'StateServer' or 'SQLServer'.]
System.Web.Util.AltSerialization.WriteValueToStream(Object value,
BinaryWriter writer) +1710
System.Web.SessionState.SessionDictionary.Serialize(BinaryWriter writer)
+148
System.Web.SessionState.StateClientManager.Serialize(SessionStateItem
item, Stream stream) +146
System.Web.SessionState.SqlStateClientManager.System.Web.SessionState.IStateClientManager.Set(String
id, SessionStateItem item, Boolean inStorage) +126
System.Web.SessionState.SessionStateModule.OnReleaseState(Object source,
EventArgs eventArgs) +464
System.Web.SyncEventExecutionStep.System.Web.HttpApplication+IExecutionStep.Execute()
+60
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&
completedSynchronously) +87