This project is read-only.

Memory issue for XSSFWorkbook

Mar 29, 2014 at 11:34 AM
Edited Mar 29, 2014 at 11:34 AM
I'm testing NPOI and I've to admit that it's awsome! very fast and solid!
But I think there are some memory issue.
When I'm opening a large xlsx the memory goes up and it ends with an NPOI.POIXMLException

I'm talking about 30 MB of files with 1 million rows (I know it's a lot of dates) but I've to work with these files..

Here is my code
IWorkbook wb;
using (FileStream file = new FileStream(excelFilePath, FileMode.Open, FileAccess.Read))
{
if (excelFilePath.ToLower().EndsWith(".xlsx"))
    wb = new XSSFWorkbook(file);  // <- NPOI.POIXMLException
else
    wb = new HSSFWorkbook(file);
}
Apr 12, 2014 at 9:56 PM
Which version of NPOI are you using? Which architecture are you running on, x86 or x64?
Apr 13, 2014 at 8:51 AM
I'm running a 32 bit application, but even with a 64 bit application the memory grows up very quickly.
I guess the problem is with XmlDocument, it's very memory greedy with big files.. I thinlk the solution it's use XmlReader (a bit harder to use but light and fast)