Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Out of memory exception – reading xml file

Status
Not open for further replies.

ashishraj14

Programmer
Mar 1, 2005
92
0
0
AU
How can I read a large xml file containing blob fields? I have an xml file that store information about products including 5 images for each product. I am getting Out of Memory Exception when I try populate Dataset using ReadXml() method. Why am I getting this exception when I am running on machine with more than 2GB of memory?

Xml file is the backup of the database and I need to restore records to a new database using this xml file. Is there any way to batch read the xml file?

Thanks
 
I have had the same thing... I turned to sql server for my database needs.

I think that .NET has a memory usage limit (I know it does in asp apps), But I have never changed it. I think that you need to change it in the App.config file (same as asp).

But, it is possible that the XML class has a natural limit because it may use Int32 for item indexes or for the memory buffer...

And no there is no way of batching the ReadXML, I even tried using Stream Reader in the hope that microsoft was wrong, it stores the hole file in memory before processing it.

Sorry
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top