Quantcast
Channel: PHPExcel Forum Rss Feed
Viewing all articles
Browse latest Browse all 2707

New Post: How to read large xlsx file using PHPExcel

$
0
0
Using the direct method (full load, no cache), you would need 9GB, that you can't get in x 86.
The method of filtering can reduce the need, but after test, the script that you use does not free memory.
But if you add
$objPHPExcel-> disconnectWorksheets();
unset ($objPHPExcel);
After having recovered data (you can also add some echo of memory_get_usage to give you an idea of what it uses as memory), you recover memory.
Remake a test as that and be patient: the file must be read as many times as it passes through the load().
Then, see if you can adjust the chunksize and if the final startrow is correct.
You can try with and without cache to find the best compromise (time / memory).
(Note: test conducted with a workbook containing a sheet with 30 columns and ~ 30 k lines, representing more than 900 k cells - 1/10 of what you have, but on my small test machine, I can hardly go further - direct loading fails - it exceeds 128 MB allowed - but pieces loading is successful, memory_get_usage reports ~ 25 MB used, memory_get_peak_usage reported 45 MB. I could therefore double the size of the chunk.
The loading takes of course much time)

Viewing all articles
Browse latest Browse all 2707

Trending Articles



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