_drupal_error_handler_real() calls debug_backtrace() and dumps it into _drupal_log_error(). When it gets to Monolog, Monolog tries to json_encode() it, and if there's an object in there, you can run out of memory. We ended up with a 500 error in production because of a deprecation notice whose debug_backtrace() included a ViewExecutable.
Either remove the backtrace entirely, or make it depend on a setting or an environment variable, so it doesn't end up in production logs.
Closed: cannot reproduce
2.0
Code