Edit report at https://bugs.php.net/bug.php?id=58982&edit=1

 ID:                 58982
 Comment by:         xantek dot imc at gmail dot com
 Reported by:        hanno at hboeck dot de
 Summary:            apc produces tons of warnings "Unable to allocate
                     memory for pool."
 Status:             Feedback
 Type:               Bug
 Package:            APC
 Operating System:   Linux
 PHP Version:        5.2.11
 Block user comment: N
 Private report:     N

 New Comment:

Had this issue with:
APC Version     3.1.9
PHP Version     5.2.17

I found viewing apc.php helpful to visualize config and cache information.  It 
seems this issue is related to configuration and not a software bug. I tweaked 
the following setting based on details found in this thread, 
http://www.php.net/manual/en/apc.configuration.php, and usage details in 
apc.php.

apc.mmap_file_mask=/dev/zero
apc.shm_size=64M
apc.ttl=0


Previous Comments:
------------------------------------------------------------------------
[2011-08-06 20:05:44] gop...@php.net

Another reason for that error is if apc_bin_* functions are used in apache.

Ideally, they're only good for command line apps - because the apc_bin_load() 
allocations qualify as memory leaks in shared memory, because the entire cache 
entry set is tied to a single allocation - so even an apc cache clear won't 
free up memory.

That's the only scenario where we probably would spam the log with such 
warnings consistently - any other scenario will only log it till the cache 
clears.

------------------------------------------------------------------------
[2011-08-05 16:59:29] ras...@php.net

@ondrej Why are you running both eAccelerator and APC? That's 
not going to work.

------------------------------------------------------------------------
[2011-08-05 10:30:49] ondrej dot hlavacek at keboola dot com

PHP 5.3.6 (cli) (built: Mar 19 2011 07:44:03)
Copyright (c) 1997-2011 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2011 Zend 
Technologies
    with eAccelerator v0.9.6.1, Copyright (c) 2004-2010 
eAccelerator, by eAccelerator
    with Xdebug v2.1.0, Copyright (c) 2002-2010, by Derick 
Rethans


APC 3.1.9

apc.enabled=1
apc.shm_segments=1
apc.shm_size=64M
apc.num_files_hint=1024
apc.user_entries_hint=4096
apc.ttl=7200
apc.use_request_time=1
apc.user_ttl=7200
apc.gc_ttl=3600
apc.cache_by_default=1
apc.filters
apc.mmap_file_mask=/tmp/apc.XXXXXX
apc.file_update_protection=2
apc.enable_cli=0
apc.max_file_size=1M
apc.stat=1
apc.stat_ctime=0
apc.canonicalize=0
apc.write_lock=1
apc.report_autofilter=0
apc.rfc1867=1
apc.rfc1867_prefix =upload_
apc.rfc1867_name=APC_UPLOAD_PROGRESS
apc.rfc1867_freq=0
apc.rfc1867_ttl=3600
apc.include_once_override=0
apc.lazy_classes=00
apc.lazy_functions=0
apc.coredump_unmap=0
apc.file_md5=0
apc.preload_path

Kernel 2.6.21.7-2.fc8xen

Server with 5 virtualhosts and max 2 users per virtualhost 
at once, happens around half an hour after apache reload.

------------------------------------------------------------------------
[2011-07-26 06:59:25] pear dot neufeind at speedpartner dot de

We seem to have run into the same problem on one server. Running php 5.3.4 with 
apc 3.1.9. Unfortunately it only seems to occur after quite some time running 
with a cache (maybe a day or more) so I don't have an easy testcase to 
reproduce it directly after apache-restarts.

------------------------------------------------------------------------
[2011-07-19 18:07:44] ceo at l-i-e dot com

Might as well add another data point:

PHP 5.3.6 (cli) (built: Mar 18 2011 14:54:34) 
Copyright (c) 1997-2011 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2011 Zend Technologies
[richard.lynch@lmsdev01 ~]$ php -i | grep -i apc
Additional .ini files parsed => /etc/php.d/apc.ini,
apc
APC Support => enabled
APC Debugging => Disabled
MMAP File Mask => /tmp/apc.S1YF0a
apc.cache_by_default => On => On
apc.canonicalize => On => On
apc.coredump_unmap => Off => Off
apc.enable_cli => On => On
apc.enabled => On => On
apc.file_md5 => Off => Off
apc.file_update_protection => 2 => 2
apc.filters => no value => no value
apc.gc_ttl => 3600 => 3600
apc.include_once_override => Off => Off
apc.lazy_classes => Off => Off
apc.lazy_functions => Off => Off
apc.max_file_size => 1M => 1M
apc.mmap_file_mask => /tmp/apc.S1YF0a => /tmp/apc.S1YF0a
apc.num_files_hint => 1024 => 1024
apc.preload_path => no value => no value
apc.report_autofilter => Off => Off
apc.rfc1867 => Off => Off
apc.rfc1867_freq => 0 => 0
apc.rfc1867_name => APC_UPLOAD_PROGRESS => APC_UPLOAD_PROGRESS
apc.rfc1867_prefix => upload_ => upload_
apc.rfc1867_ttl => 3600 => 3600
apc.shm_segments => 1 => 1
apc.shm_size => 32M => 32M
apc.slam_defense => On => On
apc.stat => On => On
apc.stat_ctime => Off => Off
apc.ttl => 7200 => 7200
apc.use_request_time => On => On
apc.user_entries_hint => 4096 => 4096
apc.user_ttl => 7200 => 7200
apc.write_lock => On => On

I can't install debug versions on this box, as it's puppet controlled by Ops.
I'll try to repo on a Desktop if they ever give me a RHEL entitlement I've been 
awaiting for a month...

Also, my app is Moodle, just in case that's relevant somehow.

------------------------------------------------------------------------


The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at

    https://bugs.php.net/bug.php?id=58982


-- 
Edit this bug report at https://bugs.php.net/bug.php?id=58982&edit=1

Reply via email to