473,659 Members | 3,082 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ReadXML OutOfMemoryExce ption

Hello guys, I have a pretty simple app that reads XML data (.ReadXML)
into an in-memory dataset, runs some linq queries, mods the data, and
then writes the XML (.WriteXML) back to disk.

Everything works well until, occasionally, I get an
OutOfMemoryExce ption. So far this has only happened for a file that
was about 50MB in size. All other, smaller files are working just
fine.

50MB (+overhead of other objects etc...) certainly does not seem like
an unreasonable amount of data to hold in memory. How can I get this
to work without the error? Can I manually allocate more memory for the
DataSet and .ReadXML? Why doesn't it take advantage of more of the
available memory?

I know that there are lots of other ways to do this...but I am not
interested in reengineering the code. I just want it to work, because
I have since moved on to other projects. Is there a "quick and dirty"
way to make my app able to handle the 50MB of data in memory? This
does not seem like it should be such a big deal.

Apparently the .ReadXML and .WriteXML methods of the DataSet are not
very scalable!?
Aug 6 '08 #1
2 3324
I'm actually fighting a bug that has something to do with this. I was
told that a few years ago Microsoft "fixed" something that made it so
their file transfer buffer is somewhere around 50MB. What this means
to a developer is there is a chance for a System exception if you try
to move more than that.

I haven't tested my code yet but right now I've got it altered so it
only moves 50MB at a time to hopefully get around this problem.
Aug 6 '08 #2
In the past, I've resorted to reading the big file a line at a time, and
breaking it down into smaller sized temp files. A low tech solution, and
you may need to be careful when splitting up the file depending on what
assumptions you can make about the format of the big file.

Moe

<jo*********@to pscene.comwrote in message
news:bd******** *************** ***********@x35 g2000hsb.google groups.com...
Hello guys, I have a pretty simple app that reads XML data (.ReadXML)
into an in-memory dataset, runs some linq queries, mods the data, and
then writes the XML (.WriteXML) back to disk.

Everything works well until, occasionally, I get an
OutOfMemoryExce ption. So far this has only happened for a file that
was about 50MB in size. All other, smaller files are working just
fine.

Aug 7 '08 #3

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

Similar topics

4
4328
by: Ryan Seghers | last post by:
I've got a program that has no user interface (like a service but not actually a Windows Service yet) in which I'd like to handle OutOfMemoryExceptions. I'd at least like to log the failure before exiting, if possible. I understand that it probably takes some memory to continue operating, even just to write a message to an open file, but if the allocation that triggered the OutOfMemoryException was large then there probably really is a...
0
2769
by: Per Bergland | last post by:
After many woes, I finally managed to get a stack dump of my System Service (written in C#) that insists on crashing when launched at system boot time (see below on how to get this dump - I couldn't find any info on how to do this). Here's the stack trace from cordbg: Unhandled exception generated: (0x04719c94) <System.Runtime.Remoting.RemotingException> _className=<null> _exceptionMethod=<null>
11
408
by: DraguVaso | last post by:
Hi, I should use XML to synchronize the data from different (VB.NET) applications, and I was just wondering which Overloads of these functions ( ReadXmlSchema, ReadXml and WriteXml) goes the fastest? I don't think the ReadXMLSchema would give a lot of difference, but maybe the overlaods of ReadXml and WriteXml will. Especially with larges files/datatables... Should I use the IO.Stream? The XmlReader/XmlWriter?
3
5988
by: Michael | last post by:
I have a problem with catching the OutOfMemoryException in a managed C+ application. When creating small objects on the managed heap neithe the catch handler for OutOfMemoryException nor the UnhandledExceptio handler is called in an out of memory situation. Instead the applicatio writes 'Fatal out of memory' to the console and exits Is this a bug in the runtime or am I missing something Here is the example code #include "stdafx.h...
1
3440
by: Ripul Handa | last post by:
Hi We are running IIS 5.0 cluster with cisco local director. We are running a website on 2 webservers and I have been observing that from past few days we have are getting this error message of and on Error Messag Remote IP:66.122.242.6 Host:216.211.212.2
1
4977
by: SMG - Idealake | last post by:
Hi all, I am getting following error on my error, what could be the reason? 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.
2
3938
by: Dave | last post by:
We just started getting this error message in our application today (stack trace below). From the OutOfMemoryException, I'm guessing it could be a memory leak. I'm making sure I'm closing all my connections in the finally block but I'm not sure what I should be doing. As far as the "Unable to serialize the session state" error, this app has been running for days and this is the first I've seen this one as well. Any thoughts would be...
13
12934
by: Venkatachalam | last post by:
Hi, In my application I have text(flat) file as input and I have to generate an XML file. The maximum input text file size can be 900MB and gererated xml may result 2+ GB. Based on the first column value from the text file, the row will be moved to any of those 23 DataTable which are created onfly. For eg. 01;- data for Table 1-
0
8335
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8851
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8747
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8627
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7356
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4175
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4335
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1976
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1737
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.