doy / spreadsheet-parsexlsx

parse XLSX files
http://metacpan.org/release/Spreadsheet-ParseXLSX
27 stars 35 forks source link

out of memory when trying to parse Excel 2016 xlsx file > 3mb #93

Open drvolk opened 4 years ago

drvolk commented 4 years ago

Hello,

the issue for "out of memory" for large files seams not to be fixed in the environment i use.

I have a Win10 64bit System , 8GB RAM and running ActiveState perl v5.24.2 (MSWin32-x86-multi-thread-64int). The Version of the Spreadsheet::ParseXLSX packages is 0.27 and the XML::Twig is 3.52 so everything seams to be up to date ...

I tried to parse an Excel 2016 file with a size of nearly 3000 kb (see attachments), wih following script an getting the "out of memory" problem:

use Spreadsheet::ParseXLSX; my $parser = Spreadsheet::ParseXLSX->new; print("parsing <$ARGV[0]> ...\n"); XML::Twig::_set_weakrefs(0); my $workbook = $parser->parse($ARGV[0]);

perl test_excel.pl test_exelv2.xlsx parsing ... Out of memory!

test_exelv2.xlsx systeminfo.docx spreadsheet_parsexllx_Twig_version.txt

bulrush15 commented 4 years ago

I'm also getting an out of memory error when I try to parse XLSX files, my file is 24.5mb. The error happens in XML::Twig. Out of memory! XML::Twig::DESTROY(c:/perlchuck/site/lib/XML/Twig.pm:3919):

My machine is Windows Server 2012, has 32GB of memory and Perl is Activestate perl:

C:\PerlProgs\Chuck\chuck\findcrlf>perl -v

This is perl 5, version 16, subversion 3 (v5.16.3) built for MSWin32-x86-multi-thread
(with 1 registered patch, see perl -V for more detail)

Copyright 1987-2012, Larry Wall

Binary build 1603 [296746] provided by ActiveState http://www.ActiveState.com
Built Mar 13 2013 11:29:21

Module info:

Current Activestate Perl version: v5.16.3
  Spreadsheet::ParseXLSX version 0.23
  XML::Twig version 3.49

If an upgrade for Activestate perl would actually help would someone let me know? I might be able to update the 2nd installation of perl and use that perl.exe for certain tasks.

UPDATE: I made a brand new XLSX file by right clicking the directory, and choosing "New Excel File". Then I opened both XLSX files and copied the one tab I need from the old file to the new XLSX file and tried to get perl to read it. I still got the same errors.

From this page I'm going to try this in my Perl program: XML::Twig::_set_weakrefs(0).