vipin93's avatar
Level 13

Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 262144 bytes)?

after upgraded to 5.4 I'm getting this on my local server I have 10k record but one more I have app which is L5.3 where in this I have 1lac record its working smooth. I just updated my app 5.3 to 5.4

Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 262144 bytes) in C:\laragon\www\gsms\vendor\laravel\framework\src\Illuminate\Container\Container.php on line 621

I try to see logfile but there is nothing show stack track

0 likes
2 replies
spekkionu's avatar

The message means your script ran out of memory.

Are you loading all 10k records at once? You likely don't need them all at once. You can use pagination or take a look at the chunk method depending on what you are doing.

Alternatively there might be a circular reference that is preventing the garbage collector from freeing memory during a large loop. You might need to manually unset the guilty variable.

Please or to participate in this conversation.