Quantcast
Channel: NPOI
Viewing all articles
Browse latest Browse all 1621

New Post: System.OutOfMemoryException when reading a large XLSX workbook

$
0
0
As stated in my original post, the Out of Memory exception is occurring when decompressing the XML from the XLSX file, not when reading the XML. The root cause is from the call to the ToArray method against the decompressed stream. This step essentially writes the entire content to the current process's memory as a byte array.

The only way to solve something like this is to change the architecture to pass a stream reference instead of a byte array.

BTW, I'm not saying that there is not an issue with the XmlDocument object and large files. I'm saying that the issue I am reporting is occurring well before it even gets to that point in the code.

Viewing all articles
Browse latest Browse all 1621

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>