Closed xPaw closed 3 years ago
Hey @xPaw; the quick solution is to increase the memory limit as you've done. However, we'd suggest you increase the memory limit carefully to a threshold that's acceptable rather than giving your script an unlimited memory allocation with -1
, as this may lead to other knock-on issues.
We're currently looking into reporting 'out of memory' errors for PHP already, so we'll be sure to let you know in this thread as soon as this is available in the Bugsnag PHP library.
Standard trick is: https://github.com/symfony/error-handler/blob/v5.2.1/ErrorHandler.php#L113-L116.
threshold that's acceptable rather than giving your script an unlimited memory allocation with -1
I know. I only threw that hack into bugsnag's shutdownHandler
function so it can send the report.
Out of Memory errors will now be reported as of v3.26.0.
Looks like this:
It's trying to allocate in
shutdownHandler
and it fails, so the error report about memory exhaustion is never actually reported. As a quick hack job, addingini_set('memory_limit', '-1');
inside ofshutdownHandler
seems to do the trick.Using PHP 8.0.0 and bugsnag v3.25.0