How to free memory after Export is created. #3930
Replies: 5 comments 2 replies
-
A tinker of the same after one, trying to clear the memory:
|
Beta Was this translation helpful? Give feedback.
-
I'm not sure what is kept in memory in your case. We are clearing up the phpspreadsheet here https://github.com/SpartnerNL/Laravel-Excel/blob/3.1/src/Writer.php#L178 |
Beta Was this translation helpful? Give feedback.
-
Hi Patrick, I get this when tinkering:
But you pointed something out (caching). I will try set a config now, using batch and see if I can connect it to redis. |
Beta Was this translation helpful? Give feedback.
-
I published a config and set it to illuminate and redis. I now get the repository as an answer:
|
Beta Was this translation helpful? Give feedback.
-
Hallo Patrick, By setting the caching to "batch" and raising the memory limit of php tot 256Mb, the crashes have disappeared. Still it seems memory is leaked somewhere, but the ratio execution time versus memory needed is acceptable. 128Mb seems to little for any table passing more then 5000 records to Excel Export at the moment? Thanks for the pointer. |
Beta Was this translation helpful? Give feedback.
-
I have some 30.000 records I want to export.
I run into memory exhaustion issues. So I thought op splitting the exports in separate files and then zip them.
However I still get into memory issues, when looping through the records, because after the export, the memory is still kept.
How can I clear memory? The following code does not work:
$exporterClassName is full className for the Exporter implementing FromCollection
Any suggestions on clearing the memory after the creation of the file?
Beta Was this translation helpful? Give feedback.
All reactions