Reputation: 8346
I using PHPExcel reader. Load function reads the Huge Excel and keeps memory until programs ends. This is affecting the program performance down the line.
I would like to clear the memory occupied by php object $objReader
& $objPHPExcel
shows in below code.
$objReader = new PHPExcel_Reader_Excel2007();
$objReader->setReadFilter( new MyReadFilter($z) );
$objReader->setReadDataOnly(true);
$objPHPExcel = $objReader->load($inputFileName);
$objSheet = $objPHPExcel->getActiveSheet();
load($inputFileName)
reads the full excel file data & stores it $objPHPExcel
Upvotes: 1
Views: 1054
Reputation: 1098
I believe you can free up the memory by disconnecting worksheets then unseting the object.
$objPHPExcel->disconnectWorksheets();
unset($objPHPExcel);
Upvotes: 5