Hey. How can I deserialize a large xml file (about 7 or 8 gigabytes) without caching? Now I am doing deserialization, and the program takes the memory until it falls off with the exception. I was told that I could use the XmlReader class, but I do not understand how to deserialize directly into my custom class.
Closed due to the fact that the essence of the issue is incomprehensible by the participants PashaPash ♦ , Nick Volynkin ♦ , Athari , aleksandr barakin , Vladimir Glinskikh 9 Aug '15 at 4:54 .
Try to write more detailed questions. To get an answer, explain what exactly you see the problem, how to reproduce it, what you want to get as a result, etc. Give an example that clearly demonstrates the problem. If the question can be reformulated according to the rules set out in the certificate , edit it .
- And the class copy will not burst? :) 7-8 GB of XML is somewhere two or three GB of memory for a class instance. Data is transferred 1: 1, tag names 1: 2, parentheses and whitespace 0: 1, goes somewhere 1: 3-1: 4 for "prettified" XML (which has indents for nesting on the entire file). - Vesper
- @Vesper: But somehow it needs to be parsed and extract the necessary data. Apparently the question is this. - Kromster
- What is the approximate value of a torn memory and with what exclusion does it fall? Application under x64 / AnyCPU collected? - PashaPash ♦
- It drops with the exception "XML file is damaged <string, position>". The line number is always different, depending on how much free memory was available .. The file is valid, the third-party software parses. - Vladimir K
- @ VladimirK and what third-party software do you use? - e1s
|