Skip to content

Instantly share code, notes, and snippets.

@radityopw
Last active January 4, 2022 05:11
Show Gist options
  • Star 13 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save radityopw/4696048 to your computer and use it in GitHub Desktop.
Save radityopw/4696048 to your computer and use it in GitHub Desktop.
free up memory on phpExcel
$objPHPExcel->disconnectWorksheets();
unset($objPHPExcel);
@IulianDide
Copy link

You saved my life :)
Thanks

@phuongcv1112
Copy link

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

Add garbageCollect() will resolve all issue of OOM

@martinKindall
Copy link

Thanks, worked for me using PhpSpreadsheet.

@look416
Copy link

look416 commented Aug 20, 2018

Thanks, it worked for me so well.

@stefanhuber
Copy link

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