Yayan
Yayan

Reputation: 1031

System.Web.HttpUnhandledException

I got error in my aspx.Below the information of the error.

Error Message   : Exception of type 'System.OutOfMemoryException' was thrown.
Source          : mscorlib
StackTrace      : at System.String.GetStringForStringBuilder(String value, Int32 startIndex, Int32 length, Int32 capacity)
   at System.Text.StringBuilder.set_Capacity(Int32 value)
   at System.Xml.BufferBuilder.ToString()
   at System.Xml.XmlTextReaderImpl.ParseText()
   at System.Xml.XmlTextReaderImpl.ParseElementContent()
   at System.Xml.XmlTextReaderImpl.Read()
   at System.Xml.XmlTextReader.Read()
   at System.Xml.XmlReader.ReadElementString()
   at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderService.Read3_GetXmlResponse()
   at Microsoft.Xml.Serialization.GeneratedAssembly.ArrayOfObjectSerializer9.Deserialize(XmlSerializationReader reader)
   at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle, XmlDeserializationEvents events)
   at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle)
   at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
   -----
   -----
   -----
Target Site     : System.String GetStringForStringBuilder(System.String, Int32, Int32, Int32)

Can any one help me ?

Thx

Upvotes: 0

Views: 2669

Answers (5)

Yayan
Yayan

Reputation: 1031

The error occurs when access web service that return xml. the return will be used in datatable.

Upvotes: 0

Vitaliy Liptchinsky
Vitaliy Liptchinsky

Reputation: 5299

You need to use .NET memory profiler to check where are memory leaks in your application. http://www.google.com/search?ie=UTF-8&oe=UTF-8&sourceid=navclient&gfns=1&q=.NET+memory+profilers

It looks like you are operating with very big string there, or some other memory leaks caused memory pressure.

Upvotes: 0

Arsen Mkrtchyan
Arsen Mkrtchyan

Reputation: 50752

When you want to add text to StringBuilder, and the current capacity is not enough StringBuilder will try to double it's capacity.

So max capacity for string is 2^32 but in your case it will want to go from 17MB to 34MB. may be you are trying to append the text to a big StringBuilder?

Upvotes: 0

rahul
rahul

Reputation: 187110

Don't know whether this solves your issue or not. But please take a look at this one

Problems with System.OutOfMemoryException At System.String.GetStringForStringBuilder in 32-Bit Managed Solutions

Upvotes: 2

Matthew Scharley
Matthew Scharley

Reputation: 132464

Your server are running out of memory. There's really three possibilities here:

  1. You need a new server. Probably not the cause.
  2. Your server is misconfigured. A possibility, especially given the stack trace.
  3. You are doing something drastically wrong. Probably the cause.

Beyond this, noone will be able to even hazard a guess at what is wrong without actually seeing the code around where the error is happening. Though, if that's a complete stack trace it may be the case that #2 is coming into play. It may be that #1 is coming into play if your server is being swamped with traffic, but really, it would take alot of traffic on any semi-modern server to trigger an out of memory error.

Upvotes: -1

Related Questions