Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Symfony Unable to allocate memory for pool [duplicate]

Possible Duplicate:
What is causing “Unable to allocate memory for pool” in PHP?

Today I noticed the next error:

ErrorException: Warning: require() [function.require]: Unable to allocate memory for pool. in /symfony/symfony/src/Symfony/Component/ClassLoader/DebugClassLoader.php line 82

Its a strange error, if I reload the page sometimes 2 files has this error, other times all the files.

It is in my JS and CSS files.

like image 548
Mitchel Verschoof Avatar asked Jan 16 '13 16:01

Mitchel Verschoof


1 Answers

This error is usually related to Alternative PHP Cache (APC) related which is a free and open opcode cache for PHP. Its goal is to provide a free, open, and robust framework for caching and optimizing PHP intermediate code. Edit /etc/php.d/apc.ini, enter:

# vi /etc/php.d/apc.ini

Make sure the mktemp-style file_mask to pass to the mmap module is correct and valid one:

apc.mmap_file_mask=/tmp/apc.XXXXXX

Next make sure the size of each shared memory segment, with M/G suffix is set correct as per your requirements. In my case it was set to 8M:

apc.shm_size=96M

You need to adjust the number of seconds a cache entry is allowed to idle in a slot in case this cache entry slot is needed by another entry:

apc.ttl=3600

The number of seconds a user cache entry is allowed to idle in a slot in case this cache entry slot is needed by another entry:

apc.user_ttl=3600

The number of seconds that a cache entry may remain on the garbage-collection list.

Save and close the file. Make sure you adjust the values as per your requirements. Restart the Apache 2 web server:

# service httpd restart
like image 96
Julien Avatar answered Oct 10 '22 15:10

Julien