-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Description
Prerequisites
- Have read and understood: https://github.com/Maatwebsite/Laravel-Excel/blob/3.1/.github/SUPPORT.md
- Checked if your Laravel Excel version is still supported: https://docs.laravel-excel.com/3.1/getting-started/support.html#supported-versions
- Checked that your question isn't already asked before.
- Filled in the entire issue template
Versions
- PHP version: 7.4.9
- Laravel version: 7.9.2
- Package version: 3.1.21
Description
Reading huge excel file (over 10MB) causes php process to be killed. The sheet causing the issue is over 75MB after uncompressing the file.
I tracked down the place causing the error, and found that simplexml_load_string consumes around 2GB of memory.
Is there a way to reduce memory usage?
This only occurs with XLSX files because other types of files does not use SimpleXML for reading.
Chunked reading does not help because the problems occurs before laravel excel starts reading rows.
The problem is happening inside PhpSpreadsheet library, and SimpleXML is not suited for reading huge file as it tries to load entire tree into memory.
PhpSpreadsheet does not probably support other types of XML parses which uses less memory, so there is nothing I can do as long as I use Laravel Excel?