Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Web Services / December 2006

Tip: Looking for answers? Try searching our database.

Out Of Memory Exception - Large Responses

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
James Hancock - 21 Nov 2006 16:10 GMT
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 Hancock

[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 ....
Phil Lee - 29 Nov 2006 08:26 GMT
James,

I have experienced the same problem, and I see at least one other person
has:
http://forums.microsoft.com/MSDN/AddPost.aspx?PostID=945264&SiteID=1&ReturnUrl=

Have the WSE3 team any comments on this, or is it a limitation of
StringBuilder?

Regards,
Phil Lee

>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
[quoted text clipped - 68 lines]
> Evolution.Web.Services.Synchronize.SynchronizeDatabase(Object sender,
> String ServerAddress) in ....
Christine - 29 Nov 2006 16:48 GMT
> 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
[quoted text clipped - 67 lines]
> Evolution.Web.Services.Synchronize.SynchronizeDatabase(Object sender, String
> ServerAddress) in ....

Hi there,

I got the same problem! Did you solve it?
If not do you have any idea?

Christine

BizTalk Utilities - Frustration free BizTalk Adapters
http://www.topxml.com/biztalkutilities
James Hancock - 02 Dec 2006 14:41 GMT
Phil, Christine,

I haven't been able to solve it! And it doesn't seem to be related to
running out of memory from the size of the response. It's something in the
message that is being constructed. It just happens on large responses, but
there is some character or something that is causing it. I haven't gotten
any response from anyone in the WSE team.

Anyone in the WSE team want to comment???

This is killing me and makes WSE very unreliable.

I have a repro case that I can show.

James Hancock

>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
[quoted text clipped - 68 lines]
> Evolution.Web.Services.Synchronize.SynchronizeDatabase(Object sender,
> String ServerAddress) in ....
James Hancock - 13 Dec 2006 18:03 GMT
MS??? Anyone want to answer this and/or tell us when you're going to fix all
of the bugs in WSE 3???

>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
[quoted text clipped - 68 lines]
> Evolution.Web.Services.Synchronize.SynchronizeDatabase(Object sender,
> String ServerAddress) in ....

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.