php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #59543 User variable minimum size is taking a lot of memory
Submitted: 2010-12-19 07:33 UTC Modified: 2011-03-10 11:26 UTC
Votes:2
Avg. Score:4.0 ± 1.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: webmaster_apc at colnect dot com Assigned:
Status: Wont fix Package: APC (PECL)
PHP Version: 5.3.2 OS: gentoo linux
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: webmaster_apc at colnect dot com
New email:
PHP Version: OS:

 

 [2010-12-19 07:33 UTC] webmaster_apc at colnect dot com
Description:
------------
On my syste, I use the user variable cache extensively and I see that even for small values of a few bytes, the minimum memory size consumed by APC is 648 bytes per variable, even if the variable is just a few bytes. In my case, this is really taking A LOT of memory.

Can this be configured or can the default be changed?
What's the advantage of deciding on such a high value?


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-12-30 11:36 UTC] gopalv@php.net
That is the default size of the pool allocator.

I've been meaning to trim it down to exactly 512 (so that it fits neatly with the Mb limits).

If  you want to know why, then take a good long look at 

http://notmysock.org/code/oscon08.pdf

Around slide #10
 [2010-12-30 11:40 UTC] gopalv@php.net
In case you really feel like tweaking stuff, you can patch

apc_realpool_create() in apc_pool.c 

turn down the APC_SMALL_POOL value to 256 ... 136 bytes per
pool block is wasted in book-keeping headers.
 [2011-01-02 04:23 UTC] webmaster_apc at colnect dot com
Thank you for your reply. However, I don't understand why this value can't be configured in apc.ini
Different systems might have a different median block size and thus may have different sizes fit for them. The slack added on my system due to this big block size is huge. Tweaking the code isn't really a long term solution to this issue so allowing a user-configuration variable seems like a good solution to me.

Thanks
 [2011-01-16 00:13 UTC] webmaster_apc at colnect dot com
Should I re-open this as a feature request?
 [2011-03-10 10:03 UTC] massimo dot sala dot 71 at gmail dot com
yes, I think it is a nice feature request.
 [2011-03-10 11:26 UTC] webmaster_apc at colnect dot com
Opened as #22592
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Dec 22 11:01:30 2024 UTC