Allowed Memory Size of 33554432 Bytes Exhausted (Tried to Allocate 43148176 Bytes) in PHP

Allowed memory size of 33554432 bytes exhausted (tried to allocate 43148176 bytes) in php

If your script is expected to allocate that big amount of memory, then you can increase the memory limit by adding this line to your php file

ini_set('memory_limit', '44M');

where 44M is the amount you expect to be consumed.

However, most of time this error message means that the script is doing something wrong and increasing the memory limit will just result in the same error message with different numbers.

Therefore, instead of increasing the memory limit you must rewrite the code so it won't allocate that much memory. For example, processing large amounts of data in smaller chunks, unsetting variables that hold large values but not needed anymore, etc.

Allowed memory size of 536870912 bytes exhausted in Laravel

You can try editing /etc/php5/fpm/php.ini:

; Old Limit
; memory_limit = 512M

; New Limit
memory_limit = 2048M

You may need to restart nginx:

sudo systemctl restart nginx

You may also have an infinite loop somewhere. Can you post the code you're calling?

Allowed memory size exhausted

Open your php.ini and edit the memory_limit line like below:

memory_limit = 512M

Probably it'll fix it but it may not. If you can not solve it, please be more spesific, add more information.

Memory available bigger than tried error in PHP

The error message tells you that a limit of 134217728 bytes (128 MB) was defined. This has already been used by your script, but it requested more. Allocating the next bytes (in your example: 20480) failed, that's why the script died.


To resolve this, you could either check why your script needs that memory (reducing the memory footprint can always be a good idea), or otherwise set a higher memory limit



Related Topics



Leave a reply



Submit