I have a datatable that contains over 10 000 rows.
When, I do :
Dim oTable As New System.Data.DataTable
' .....
' Filling the DataTable
' .....
oTable.writeXml("MyFile.xml")
Do the writexml() uses memory or HardDrive ?
I tested, and I find out that it uses a lot of memory.
Writing a file normally uses FileStreams. So it should not uses memory.
Am I wrong ?
I don’t think WriteXML eating memory is normal. Just tested with 287,120 rows in a table (exported XML is nearly 200MB in size) – memory usage stayed the same. It took around 1.2GB to load this table into memory, and then open it in the editor. After running WriteXML memory consumption stayed the same during those 4-5 seconds, maybe going up and down by 1MB.
How are you filling the DataTable? If you are using some lazy loading techniques, that may explain high memory usage, but that would be not by WriteXML, and rather by the data itself.