Do you know any solution to recover from the PHP fatal error : \"Allowed memory size ... exhausted\"
I have a shutdown function that is called when a fatal
One I can think of is that you when you're doing your memory intensive operation you manually query memory_get_usage()
on a regular basis (e.g. every loop iteration) and dump out your headers/error when it goes over some failsafe value which is below the script limit. It will slow your script down a lot, but at least you'll get something back.
Or, and you may not be able to do this, run the memory intensive stuff as a CLI-based script called from inside your web-based stuff by using exec. The CLI part might fall over, but the web part will be able to report on it.