Fatal error: Out of memory (allocated 962592768) (tried to allocate 4096 bytes)

Hello,

I am trying to export the contents of a grid application to Excel. I tried with xls and xlsx format, but error is always generated. In CSV format it takes a long time although the application manages to export all the records.

If I export to xls format only 19 records of a total of 79000 are exported. If I export to xlsx it does not end up exporting since it generates this message.

Fatal error: Out of memory (allocated 962592768) (tried to allocate 4096 bytes) in C: \ xampp \ htdocs \ scriptcase \ prod \ third \ phpexcel \ PHPExcel \ Style \ Supervisor.php on line 123. Fatal error: Out of memory (allocated 962592768) (tried to allocate 49152 bytes) in Unknown on line 0

I have modified the php.ini file to expand the memory, but I get the same error message…

Someone has an idea of ​​how to solve this problem and how to make the export not take so long. The current process to export the 79000 records takes more than 20 minutes and in the end always generates the error. I am using version 9.3.011, I already tried 9.3.012 and 9.4 and it doesn’t work.

Please help me urgently.

Thank you,

If you can first limit the amount of columns, that would be step one to get rid of anything unnecessary. For testing try
ini_set(‘memory_limit’, ‘-1’); and tell me what you get

for me you would rather have an error in the field data,
try to use addslashes to export your data, if you only export 19 fields,
there is maybe a prohibited character,
so utf8 and utf8_decode are to use
ex: $rowDate .= “’”.addslashes($objPHPExcel->getActiveSheet()->getCellByColumnAndRow($colum, $row)->getValue())."’";

Hello,

Thank you for your answers. I will test your suggestion and tell you the result.

Again thank you very much.