473,396 Members | 1,853 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Out of memory error!

Hi,

I am using MTOM and WSE 2.0 and trying to upload a file which is
almost 70MB (big). I have setup the timeout to a good size and file
size limit to 100MB in the server. The uploading is coming through T3
pipe. Even with all the changes, I get a 'out of memory' error. Can
someone help?

In my code, I am reading the file into a byte array. I don't think
reading the byte array has any problem.

Following is the actual exception

System.OutOfMemoryException: Exception of type
'System.OutOfMemoryException' was thrown.
at System.String.GetStringForStringBuilder(String value, Int32
startIndex, Int32 length, Int32 capacity)
at System.Convert.ToBase64String(Byte[] inArray, Int32 offset,
Int32 length, Base64FormattingOptions options)
at System.Convert.ToBase64String(Byte[] inArray)
at Microsoft.Web.Services3.Mime.XopNodeData.GetString ()
at Microsoft.Web.Services3.Mime.XopContentsNode.get_D ata()
at System.Xml.XmlText.get_Value()
at
Microsoft.Web.Services3.Security.Xml.ElementCanoni calizationDispatcher.Write(XmlNode
node)
at
Microsoft.Web.Services3.Security.Xml.ElementCanoni calizationDispatcher.WriteElement(XmlElement
node)
at
Microsoft.Web.Services3.Security.Xml.ElementCanoni calizationDispatcher.Write(XmlNode
node)
at
Microsoft.Web.Services3.Security.Xml.ElementCanoni calizationDispatcher.WriteElement(XmlElement
node)
at
Microsoft.Web.Services3.Security.Xml.ElementCanoni calizationDispatcher.Write(XmlNode
node)
at
Microsoft.Web.Services3.Security.Xml.ElementCanoni calizationDispatcher.WriteElement(XmlElement
node)
at
Microsoft.Web.Services3.Security.Xml.ElementCanoni calizationDispatcher.Write(XmlNode
node)
at
Microsoft.Web.Services3.Security.Xml.Canonicalizat ionDriver.WriteTo(CanonicalEncoder
encoder)
at
Microsoft.Web.Services3.Security.Xml.XmlDsigExcC14 NTransform.GetHashedOutput(HashAlgorithm
hash)
at
Microsoft.Web.Services3.Security.TransformChain.Tr ansformAndHash(Object
inputObject, HashAlgorithm algorithm)
at
Microsoft.Web.Services3.Security.SignatureReferenc e.CalculateHashValue(XmlDocument
document, CanonicalXmlNodeList refList)
at
Microsoft.Web.Services3.Security.MessageSignature. BuildDigestedReferences()
at
Microsoft.Web.Services3.Security.MessageSignature. ComputeKeyedHashSignature(SymmetricKeyAlgorithm
key)
at
Microsoft.Web.Services3.Security.MessageSignature. ComputeSignature()
at
Microsoft.Web.Services3.Security.Security.Serializ eXml(SoapEnvelope
document)
at
Microsoft.Web.Services3.Security.SecurityOutputFil ter.ProcessHeader(Security
security, SoapEnvelope envelope)
at
Microsoft.Web.Services3.Security.SecurityOutputFil ter.ProcessMessage(SoapEnvelope
envelope)
at
Microsoft.Web.Services3.Security.Wse2PipelinePolic y.LegacyFilterWrapper.ProcessMessage(SoapEnvelope
envelope)
at
Microsoft.Web.Services3.Pipeline.ProcessOutputMess age(SoapEnvelope
envelope)
at Microsoft.Web.Services3.Xml.SoapEnvelopeWriter.Fin ish()
at Microsoft.Web.Services3.Xml.XmlWrappingWriter.Flus h()
at
System.Web.Services.Protocols.SoapHttpClientProtoc ol.Serialize(SoapClientMessage
message)
at
System.Web.Services.Protocols.SoapHttpClientProtoc ol.Invoke(String
methodName, Object[] parameters)

Mar 29 '07 #1
1 9287
Hi there.

Did you manage to find a fix?

I am seeing something very similar with MTOM + WSE3. I have modified the
WSE 3 sample "BinaryDataMTOM" so that the sample method RunPutStreaming tries
to upload a very large file(200MB). I am running the client and the server
within Visual Studio on the same physical host.

Like you, I have also adjusted the web.config and machine.config files to
include:

<httpRuntime maxRequestLength="200000" useFullyQualifiedRedirectUrl="true"
executionTimeout="5000" />

and I've also added this to my web.config:
<messaging>
<mtom serverMode="optional" />
<maxMessageLength value="1024000" />
</messaging>

I can successfully send a file of 5MB to the server, but with 200MB I get
this exception:

A first chance exception of type 'System.OutOfMemoryException' occurred in
Microsoft.Web.Services3.dll
System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException'
was thrown.
at System.String.GetStringForStringBuilder(String value, Int32
startIndex, Int32 length, Int32 capacity)
at System.Convert.ToBase64String(Byte[] inArray, Int32 offset, Int32
length, Base64FormattingOptions options)
at System.Convert.ToBase64String(Byte[] inArray)
at Microsoft.Web.Services3.Mime.XopNodeData.GetString ()
at Microsoft.Web.Services3.Mime.XopContentsNode.get_D ata()
at System.Xml.XmlText.get_Value()
at System.Xml.XmlDocument.ImportNodeInternal(XmlNode node, Boolean deep)
at System.Xml.XmlDocument.ImportChildren(XmlNode fromNode, XmlNode
toNode, Boolean deep)
at System.Xml.XmlDocument.ImportNodeInternal(XmlNode node, Boolean deep)
at System.Xml.XmlDocument.ImportChildren(XmlNode fromNode, XmlNode
toNode, Boolean deep)
at System.Xml.XmlDocument.ImportNodeInternal(XmlNode node, Boolean deep)
at System.Xml.XmlDocument.ImportChildren(XmlNode fromNode, XmlNode
toNode, Boolean deep)
at System.Xml.XmlDocument.ImportNodeInternal(XmlNode node, Boolean deep)
at System.Xml.XmlDocument.ImportChildren(XmlNode fromNode, XmlNode
toNode, Boolean deep)
at System.Xml.XmlDocument.ImportNodeInternal(XmlNode node, Boolean deep)
at System.Xml.XmlDocument.ImportChildren(XmlNode fromNode, XmlNode
toNode, Boolean deep)
at System.Xml.XmlDocument.ImportNodeInternal(XmlNode node, Boolean deep)
at System.Xml.XmlDocument.ImportNode(XmlNode node, Boolean deep)
at Microsoft.Web.Services3.SoapFilter.CreateTraceEntr y(Type processor,
String description, XmlNode content)
at Microsoft.Web.Services3.Pipeline.ProcessOutputMess age(SoapEnvelope
envelope)
at Microsoft.Web.Services3.Xml.SoapEnvelopeWriter.Fin ish()
at Microsoft.Web.Services3.Xml.XmlWrappingWriter.Flus h()
at
System.Web.Services.Protocols.SoapHttpClientProtoc ol.Serialize(SoapClientMessage message)
at System.Web.Services.Protocols.SoapHttpClientProtoc ol.Invoke(String
methodName, Object[] parameters)
at
localhost.BinaryDataMTOMServiceWse.PutFileStreamin g(GetFileRequestStreaming
getFileResponseStreaming) in C:\Program Files\Microsoft
WSE\v3.0\Samples\CS\QuickStart\Basic\BinaryDataMTO M\BinaryDataMTOMClient\Web
References\localhost\Reference.cs:line 148
at BinaryDataMTOMClient.BinaryDataMTOMClient.RunPutSt reaming() in
C:\Program Files\Microsoft
WSE\v3.0\Samples\CS\QuickStart\Basic\BinaryDataMTO M\BinaryDataMTOMClient\BinaryDataMTOMClient.cs:lin e 148
at BinaryDataMTOMClient.BinaryDataMTOMClient.Main(Str ing[] args) in
C:\Program Files\Microsoft
WSE\v3.0\Samples\CS\QuickStart\Basic\BinaryDataMTO M\BinaryDataMTOMClient\BinaryDataMTOMClient.cs:lin e 66

Can anyone offer a suggestion please?

Thanks.
"DBC User" wrote:
Hi,

I am using MTOM and WSE 2.0 and trying to upload a file which is
almost 70MB (big). I have setup the timeout to a good size and file
size limit to 100MB in the server. The uploading is coming through T3
pipe. Even with all the changes, I get a 'out of memory' error. Can
someone help?

In my code, I am reading the file into a byte array. I don't think
reading the byte array has any problem.

Following is the actual exception

System.OutOfMemoryException: Exception of type
'System.OutOfMemoryException' was thrown.
at System.String.GetStringForStringBuilder(String value, Int32
startIndex, Int32 length, Int32 capacity)
at System.Convert.ToBase64String(Byte[] inArray, Int32 offset,
Int32 length, Base64FormattingOptions options)
at System.Convert.ToBase64String(Byte[] inArray)
at Microsoft.Web.Services3.Mime.XopNodeData.GetString ()
at Microsoft.Web.Services3.Mime.XopContentsNode.get_D ata()
at System.Xml.XmlText.get_Value()
at
Microsoft.Web.Services3.Security.Xml.ElementCanoni calizationDispatcher.Write(XmlNode
node)
at
Microsoft.Web.Services3.Security.Xml.ElementCanoni calizationDispatcher.WriteElement(XmlElement
node)
at
Microsoft.Web.Services3.Security.Xml.ElementCanoni calizationDispatcher.Write(XmlNode
node)
at
Microsoft.Web.Services3.Security.Xml.ElementCanoni calizationDispatcher.WriteElement(XmlElement
node)
at
Microsoft.Web.Services3.Security.Xml.ElementCanoni calizationDispatcher.Write(XmlNode
node)
at
Microsoft.Web.Services3.Security.Xml.ElementCanoni calizationDispatcher.WriteElement(XmlElement
node)
at
Microsoft.Web.Services3.Security.Xml.ElementCanoni calizationDispatcher.Write(XmlNode
node)
at
Microsoft.Web.Services3.Security.Xml.Canonicalizat ionDriver.WriteTo(CanonicalEncoder
encoder)
at
Microsoft.Web.Services3.Security.Xml.XmlDsigExcC14 NTransform.GetHashedOutput(HashAlgorithm
hash)
at
Microsoft.Web.Services3.Security.TransformChain.Tr ansformAndHash(Object
inputObject, HashAlgorithm algorithm)
at
Microsoft.Web.Services3.Security.SignatureReferenc e.CalculateHashValue(XmlDocument
document, CanonicalXmlNodeList refList)
at
Microsoft.Web.Services3.Security.MessageSignature. BuildDigestedReferences()
at
Microsoft.Web.Services3.Security.MessageSignature. ComputeKeyedHashSignature(SymmetricKeyAlgorithm
key)
at
Microsoft.Web.Services3.Security.MessageSignature. ComputeSignature()
at
Microsoft.Web.Services3.Security.Security.Serializ eXml(SoapEnvelope
document)
at
Microsoft.Web.Services3.Security.SecurityOutputFil ter.ProcessHeader(Security
security, SoapEnvelope envelope)
at
Microsoft.Web.Services3.Security.SecurityOutputFil ter.ProcessMessage(SoapEnvelope
envelope)
at
Microsoft.Web.Services3.Security.Wse2PipelinePolic y.LegacyFilterWrapper.ProcessMessage(SoapEnvelope
envelope)
at
Microsoft.Web.Services3.Pipeline.ProcessOutputMess age(SoapEnvelope
envelope)
at Microsoft.Web.Services3.Xml.SoapEnvelopeWriter.Fin ish()
at Microsoft.Web.Services3.Xml.XmlWrappingWriter.Flus h()
at
System.Web.Services.Protocols.SoapHttpClientProtoc ol.Serialize(SoapClientMessage
message)
at
System.Web.Services.Protocols.SoapHttpClientProtoc ol.Invoke(String
methodName, Object[] parameters)

May 1 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Srijit Kumar Bhadra | last post by:
Hello, Here is some sample code with pywin32 build 203 and ctypes 0.9.6. Best regards, /Srijit File: SharedMemCreate_Mutex_win32all.py # This application should be used with...
1
by: Attila.Rajmund.Nohl | last post by:
Hello! I'm using KAI C++ Compiler (KCC) Version 4.0d on Sparc Solaris 8 with Sun WorkShop 6 update 2 backend (KCC compiles C++ code to C than uses the Sun compiler to produce machine...
6
by: Andrzej | last post by:
Used to read newsgroup for answers, now have to ask for them as well. I have an application (C#, .NET 1.1) that connects to local db on MSDE 2000 SP3a (using ADO from MDAC 2.71) on one side and...
25
by: Zeng | last post by:
I finally narrowed down my code to this situation, quite a few (not all) of my CMyClass objects got hold up after each run of this function via the simple webpage that shows NumberEd editbox. My...
4
by: Sean Shanny | last post by:
To all, Running into an out of memory error on our data warehouse server. This occurs only with our data from the 'September' section of a large fact table. The exact same query running over...
2
by: saran | last post by:
I am having a problem with MySQL consuming a lot of memory and eventually throwing an Out of Memory error and restarting itself. The symptoms are that swap usage continues to rise until some...
6
by: tgnelson85 | last post by:
Hello, C question here (running on Linux, though there should be no platform specific code). After reading through a few examples, and following one in a book, for linked lists i thought i would...
5
by: kumarmdb2 | last post by:
Hi guys, For last few days we are getting out of private memory error. We have a development environment. We tried to figure out the problem but we believe that it might be related to the OS...
27
by: George2 | last post by:
Hello everyone, Should I delete memory pointed by pointer a if there is bad_alloc when allocating memory in memory pointed by pointer b? I am not sure whether there will be memory leak if I do...
2
by: ravishi | last post by:
Well, this is my first topic at this forum and I'm a newbie on C programming too. I'm coding a little program and I've used some "dynamic arrays" on it. Compiling and running the program on Linux...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.