views:

237

answers:

2

I have a VS 2005 application using C++ . It basically importing a large XML of around 9 GB into the application . After running for more than 18 hrs it gave an exception 0xc0000006 In page error. THe virtual memory consumed is 2.6 GB (I have set the 3GB) flag.

Does any one have a clue as to what caused this error and what could be the solution

A: 

9Gb seems overly large to read in. I would say that even 3Gb is too large in one go.

Is your OS 64bit?

What is the maximum pagefile size set to?

How much RAM do you have?

Were you running this in debug or release mode?

I would suggest that you try to reading the XML in smaller chunks.

Why are you trying to read in such a large file in one go?

I would imagine that your application took so long to run before failing as it started to copy the file into virtual memory, which is basically a large file on the hard disk. Thus the OS is reading the XML from the disk and writing it back onto a different area of disk.

**Edit - added text below **

Having had a quick peek at Expat XML parser it does look as if you're running into problems with stack or event handling, most likely you are adding too much to the stack.

Do you really need 3Gb of data on the stack? At a guess I would say that you are trying to process a XML database file, but I can't imagine that you have a table row that is so large.

I think that really you should use it to search for key areas and discard what is not wanted.

I know nothing other than what I have just read about Expat XML Parser but would suggest that you are not using it in the most efficient manner.

ChrisBD
My OS is 32 bit. I have a 2 GB Ram (I have set the 3 GB flag)I am running the code in release mode . I am using expat parser which is much like SAX parser
sameer karjatkar
A: 

Instead of loading the whole file into the memory you can use SAX parsers to load only a part of the file to the memory.

Naveen