Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 72 bytes)

Few days ago I started a new Symfony2 application and I get some troubles with cache:

$ rm -rf ./app/cache/*
$ rm -rf ./app/logs/*
$ ./app/console cache:clear

Clearing the cache for the dev environment with debug true

Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 72 bytes) in /Users/simonegentili/Development/Www/shop_website/vendor/twig/twig/lib/Twig/Node/Text.php on line 23

And ...

$ ./app/console cache:clear --env=prod

works fine.

like image 779
sensorario Avatar asked Mar 09 '13 08:03

sensorario


People also ask

How do I fix fatal error allowed the memory size of 134217728 bytes exhausted?

The correct way is to edit your php. ini file. Edit memory_limit to your desire value. As from your question, 128M (which is the default limit) has been exceeded, so there is something seriously wrong with your code as it should not take that much.

How do I fix fatal error allowed memory size?

Fix error allowed memory size WP with WHMLog in to WHM. Go to "MultiPHP INI Editor". If you have multiple PHP versions on the server, set the one that is responsible for the problem with your Wordpress website. Scroll down where it says "memory_limit" and immediately make it 256M or even 512M.

How do I fix the allowed memory size 1610612736 bytes exhausted?

Allowed memory size of 1610612736 bytes exhausted ??? can someone help me this? Try prefixing your command with COMPOSER_MEMORY_LIMIT=-1 . This will remove the memory limit for the execution of the command.


1 Answers

I had such problem in the past. Looks like for big projects this CLI script try to make too much work. As I discover it possible set amount of memory available in this case:

sudo php -d memory_limit=256M app/console cache:clear
like image 176
Павел Осипов Avatar answered Oct 28 '22 01:10

Павел Осипов