OutOfMemoryException в ASP.NET при передаче массива байт в метод web-службы
Релиб
Форумы       Участники    Календарь    Кто он-лайн?
Добро пожаловать, гость ( Вход | Регистрация )
        



OutOfMemoryException в ASP.NET при передаче... Expand / Collapse
Автор
Сообщение
05.03.2007 15:40
Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

участник
Last Login: 02.08.2008 10:18
Сообщ.: 143, Visits: 1 405
Доброе время суток!

Такая проблема. Есть метод web-службы с сигнатурой

[WebMethod] public void AddData( Byte [ ] b_ar , ...){...}

Файлик, чуть больше 60 МБ пересылается как байтовый массив данным методом. В файле конфигурации службы элемент maxRequestLength установлен по-максимуму. При вызове метода с localhost все нормально, но вот при вызове метода от-publish - ой службы удаленного сервера получаю такое исключение. Восстановленное исключение :

Exception of type 'System.OutOfMemoryException' was thrown.

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.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.

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.]   System.String.GetStringForStringBuilder(String value, Int32 startIndex, Int32 length, Int32 capacity) +34   System.Text.StringBuilder.set_Capacity(Int32 value) +71   System.Xml.BufferBuilder.ToString() +136   System.Xml.XmlTextReaderImpl.ParseText() +397   System.Xml.XmlTextReaderImpl.ParseElementContent() +511   System.Xml.XmlTextReaderImpl.Read() +26   System.Xml.XmlTextReader.Read() +12   System.Web.Services.Protocols.SoapEnvelopeReader.Read() +17   System.Xml.XmlTextReaderImpl.InitReadElementContentAsBinary() +35   System.Xml.XmlTextReaderImpl.ReadElementContentAsBase64(Byte[] buffer, Int32 index, Int32 count) +132   System.Xml.XmlTextReader.ReadElementContentAsBase64(Byte[] buffer, Int32 index, Int32 count) +21   System.Xml.Serialization.XmlSerializationReader.ReadByteArray(Boolean isBase64) +195   System.Xml.Serialization.XmlSerializationReader.ToByteArrayBase64(Boolean isNull) +19   Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReader1.Read94_UpLoad() +318   Microsoft.Xml.Serialization.GeneratedAssembly.ArrayOfObjectSerializer152.Deserialize(XmlSerializationReader reader) +40   System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle, XmlDeserializationEvents events) +402   System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle) +32   System.Web.Services.Protocols.SoapServerProtocol.ReadParameters() +1443   System.Web.Services.Protocols.WebServiceHandler.CoreProcessRequest() +479   System.Web.Services.Protocols.SyncSessionlessHandler.ProcessRequest(HttpContext context) +4   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +154   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +64


Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.42
--.

Памяти на сервере до ентой матери, явно намного больше чем у меня. Судя по трассировке стека, исключение генерируется уже в момент преобразования строкового представления массива байт в кодировке base64Binary в фактический байтовый массив.

Какое может быть отличие web-службы на localhost от скомпилированной на сервере? В чём может отличаться обработка запроса в ASP.NET на localhost от ASP.NET на сервере ?

У меня самого только такие подозрения.

Men in black

Сообщ. #911250
05.03.2007 16:46
Forum Member

Forum MemberForum MemberForum MemberForum MemberForum MemberForum MemberForum MemberForum Member

участник
Last Login: 27.02.2008 16:42
Сообщ.: 43, Visits: 1 569
Я пoлaгaю чтo этo связaнo с известнoй прoблемoй пaмяти при рaбoте с бoльшими oбъектaми в .Net. Этo известный bug и oн устрaнён (нaскoлькo я знaю) в Framework 2 SP2.
Сообщ. #911253
05.03.2007 21:52
Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

участник
Last Login: 02.08.2008 10:18
Сообщ.: 143, Visits: 1 405
Хм, ясно, попробую SP2 поставить. Спасибо.

Что-то строка сообщения в топике расползается в линию.

Men in black

Сообщ. #911267
« пред. тема | след. тема »


Эту тему читают Expand / Collapse
Посетители: 0 (0 гостей, 0 участников, 0 скрыт.участников)
Сейчас нет участников, просматривающих тему.
Модераторы: Alexey, boombastik, bazile, pl, Alexey Spirin

Время GMT +3:00, Сейчас 1:29