Re: Out Of Memory Exception - Large Responses



MS??? Anyone want to answer this and/or tell us when you're going to fix all of the bugs in WSE 3???


"James Han***" <~james@xxxxxxxxxxxxxxxxxxxxx> wrote in message news:B73486AB-7685-459F-896D-BD4FCDE19992@xxxxxxxxxxxxxxxx
I have a web service that recently started throwing an out of memory exception on responses from the web server. Any response that is more than about 30 megs in size gets this out of memory exception in StringBuilder (error info below).

If I out at one of my output filters, I can see that the envelope.Body throws an error for each and every property on it with the same error.

Any ideas on what's going on? It looks like a bug in the XML engine in .NET to me???

Thanks
James Han***

[OutOfMemoryException]: Exception of type 'System.OutOfMemoryException' was thrown.
at System.String.GetStringForStringBuilder(String value, Int32 startIndex, Int32 length, Int32 capacity)
at System.Text.StringBuilder.GetNewString(String currentString, Int32 requiredLength)
at System.Text.StringBuilder.Append(Char value)
at System.IO.StringWriter.Write(Char value)
at System.Xml.XmlTextWriter.InternalWriteEndElement(Boolean longFormat)
at System.Xml.XmlTextWriter.WriteFullEndElement()
at System.Xml.XmlElement.WriteTo(XmlWriter w)
at System.Xml.XmlElement.WriteContentTo(XmlWriter w)
at System.Xml.XmlElement.WriteTo(XmlWriter w)
at System.Xml.XmlElement.WriteContentTo(XmlWriter w)
at System.Xml.XmlNode.get_InnerXml()
at System.Xml.XmlElement.get_InnerXml()
at Microsoft.Web.Services3.Security.EncryptedData.EncryptContent(XmlDocument document, XmlElement element, String id)
at Microsoft.Web.Services3.Security.EncryptedData.Encrypt(XmlDocument message, XmlElement targetElement, String type, String id)
at Microsoft.Web.Services3.Security.EncryptedData.Encrypt(XmlDocument message)
at Microsoft.Web.Services3.Security.Security.SerializeXml(SoapEnvelope document)
at Microsoft.Web.Services3.Security.Security.Execute(SoapEnvelope envelope)
at Microsoft.Web.Services3.Security.SendSecurityFilter.ProcessMessage(SoapEnvelope envelope)
at Microsoft.Web.Services3.Pipeline.ProcessOutputMessage(SoapEnvelope envelope)
at Microsoft.Web.Services3.WseProtocol.GetFilteredResponseEnvelope(SoapEnvelope outputEnvelope)
at Microsoft.Web.Services3.WseProtocol.ProcessResponseEnvelope(Object sender, EventArgs e)
at Microsoft.Web.Services3.Xml.XmlWrappingWriter.Finish()
at Microsoft.Web.Services3.Xml.XmlWrappingWriter.Flush()
at System.Web.Services.Protocols.SoapServerProtocol.WriteReturns(Object[] returnValues, Stream outputStream)
at System.Web.Services.Protocols.WebServiceHandler.WriteReturns(Object[] returnValues)
at System.Web.Services.Protocols.WebServiceHandler.Invoke()
at System.Web.Services.Protocols.WebServiceHandler.CoreProcessRequest()
at System.Web.Services.Protocols.SyncSessionlessHandler.ProcessRequest(HttpContext context)
at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
-->
--.
Stack Trace: at Evolution.Web.Services.Synchronize.SynchronizeDatabase(Object sender, String ServerAddress) in ....

.