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

A few days ago, I started a new Symfony2 application and I had problems with the 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 great.

+5
source share
1 answer

I had such a problem in the past. For large projects, this CLI script seems to be trying to do too much work. Since I found that in this case you can set the amount of memory:

sudo php -d memory_limit=256M app/console cache:clear
+15
source

All Articles