Thursday, March 16, 2017

Allowed memory size exhausted in Laravel's CheckForMaintenanceMode middleware

I'm getting the following error in my Laravel 5.2 app:

E_ERROR: Allowed memory size of 536870912 bytes exhausted (tried to allocate 73728 bytes)

in

/Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode::handle

The error is logged on the server and the error rate is low, which means that the problem is kind of "random", or in other words - occurring only on small percentage of requests.

As far as I know, the CheckForMaintenanceMode is the first middleware to run, on every request. What might be the reason of the memory exhaustion so soon in the request stack? Or, how could I debug this?



via lesssugar

Advertisement