I am using QT4.8 with 32 bit Visual Studio 2010. I am trying to change some content of an XML File in a function.The function begins like that
QFile* myXmlFile;
QDomDocument myDom;
...
myDom.setContent(myXmlFile);
The Function works just fine when the xml file is smaller than 24 Mb. However, when I have file larger than that, the program crashes at the last line above. I found a similar question but it says the error occurs after 200Mb and the problem seems different.
I have 16 Gb of memory and you can hardly see the change in memory use, so it's probably not due to lack of memory.
When I use try catch block to see the problem, it says there is a bad allocation exception. It seems QDomDocument fails to allocate more than 24 MB, although there is far more free memory in the computer. I read Qt documents for QDomDocument but found no clue.
Is there a way I can let the program or that QDomDocument object to use more memory or do you think it is a different problem?