Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
free up memory on phpExcel
$objPHPExcel->disconnectWorksheets();
unset($objPHPExcel);
@IulianDide
Copy link

IulianDide commented Jan 19, 2017

You saved my life :)
Thanks

@phuongcv1112
Copy link

phuongcv1112 commented Jan 18, 2018

$objPHPExcel->disconnectWorksheets();
$objPHPExcel->garbageCollect();
unset($objPHPExcel);

Add garbageCollect() will resolve all issue of OOM

@martinKindall
Copy link

martinKindall commented Jul 25, 2018

Thanks, worked for me using PhpSpreadsheet.

@look416
Copy link

look416 commented Aug 20, 2018

Thanks, it worked for me so well.

@stefanhuber
Copy link

stefanhuber commented Mar 6, 2019

Great! This worked for php spreadsheet as well...

@jnilla
Copy link

jnilla commented Jan 4, 2022

OMG thanks for this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment