Saturday, March 24, 2012

Serialize session state & OutOfMemoryError?

I have an application running on a 3 server webfarm running Windows 2003 wit
h
SQLServer Session state. After running for several hours, I started getting
the following error. When I access each app individually, only one of the
servers seems to return this error when I step through a sequence. I was
told that I'm trying to store an object not marked as Serializable but I've
tested this on a dev machine storing session variables without any problems,
plus it works for several hours before I have issues. I think something els
e
is the root of this error but I don't know where to look exactly.
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 abou
t
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) +1711
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.IState
ClientManager.Set(String id, SessionStateItem item, Boolean inStorage) +126
System.Web.SessionState.SessionStateModule.OnReleaseState(Object source,
EventArgs eventArgs) +465
System.Web.SyncEventExecutionStep.System.Web.HttpApplication+IExecutionStep.
Execute() +60
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&
completedSynchronously) +87many objects are serialiable until an unserialiable property is set, or an
unserialiable object is added.
-- bruce (sqlwork.com)
"Dave" <Dave@.discussions.microsoft.com> wrote in message
news:F64A9CC1-7B9B-411A-A8FB-1B9CF6C0FFEB@.microsoft.com...
>I have an application running on a 3 server webfarm running Windows 2003
>with
> SQLServer Session state. After running for several hours, I started
> getting
> the following error. When I access each app individually, only one of the
> servers seems to return this error when I step through a sequence. I was
> told that I'm trying to store an object not marked as Serializable but
> I've
> tested this on a dev machine storing session variables without any
> problems,
> plus it works for several hours before I have issues. I think something
> else
> is the root of this error but I don't know where to look exactly.
> 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) +1711
> 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.ISta
teClientManager.Set(String
> id, SessionStateItem item, Boolean inStorage) +126
> System.Web.SessionState.SessionStateModule.OnReleaseState(Object source,
> EventArgs eventArgs) +465
> System.Web.SyncEventExecutionStep.System.Web.HttpApplication+IExecutionSte
p.Execute()
> +60
> System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&
> completedSynchronously) +87
>
>
Bruce,
Sorry, can you expand on that? If I'm adding a dataset to my session and a
few hours into the day I start to get this error on one of the servers, I'm
not sure how that it explains the problem
Thanks.
"Bruce Barker" wrote:

> many objects are serialiable until an unserialiable property is set, or an
> unserialiable object is added.
>
> -- bruce (sqlwork.com)
>
> "Dave" <Dave@.discussions.microsoft.com> wrote in message
> news:F64A9CC1-7B9B-411A-A8FB-1B9CF6C0FFEB@.microsoft.com...
>
>

0 comments:

Post a Comment