Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[8.x] Increase reserved memory for error handling #42646

Merged
merged 3 commits into from
Jun 3, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/Illuminate/Foundation/Bootstrap/HandleExceptions.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class HandleExceptions
*/
public function bootstrap(Application $app)
{
self::$reservedMemory = str_repeat('x', 10240);
self::$reservedMemory = str_repeat('x', 32768);

$this->app = $app;

Expand Down Expand Up @@ -203,6 +203,8 @@ protected function renderHttpResponse(Throwable $e)
*/
public function handleShutdown()
{
self::$reservedMemory = null;

if (! is_null($error = error_get_last()) && $this->isFatal($error['type'])) {
$this->handleException($this->fatalErrorFromPhpError($error, 0));
}
Expand All @@ -217,8 +219,6 @@ public function handleShutdown()
*/
protected function fatalErrorFromPhpError(array $error, $traceOffset = null)
{
self::$reservedMemory = null;

return new FatalError($error['message'], 0, $error, $traceOffset);
}

Expand Down