Fatal error: Allowed memory size of 1602224128 bytes exhausted

Topics: Developer Forum, User Forum
Feb 26, 2014 at 4:36 PM
Edited Feb 26, 2014 at 4:37 PM
Hi.. my dedicated server has 16 GB RAM and I tried to create a dynamic excel sheet containing 48000 rows and 24 columns. Instead of writing the excel file to disk, i am pushing to client browser realtime in the following way:

_header("Content-Type: application/vnd.ms-excel");
header("Content-Disposition: attachment;filename=$report_filename");
header("Cache-Control: max-age=0");
$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel5');
$objWriter->save('php://output');_

With this much data the Excel generation now shows memory out error. The original php.ini is set with 'memory_limit=1528M'

In this situation, what do you gurus suggest to overcome the memory limit issue other than increasing the limit?

Thanks,
Justine
Coordinator
Feb 26, 2014 at 5:10 PM
Edited Feb 26, 2014 at 5:11 PM
You probably won't be able to assign 16GB to php.ini, now should you in a multi-user environment

The recommendation is to use cell caching, as described in section 4.2.1 of the developer documentation