Re: multiple segments of shared memory?
| From: | Alexander Romanovich | Date: | Tue, 08 Feb 2011 18:04:51 +0000 |
| Subject: | Re: multiple segments of shared memory? | ||
| References: | 1 | Groups: | php.apc.dev |
| Request: | Send a blank email to php-apc-dev+get-267@lists.php.net to get a copy of this message | ||
Sorry for the non-wrapping in my original post.
Just for clarity, I'm talking about reserving a portion of the global shared memory space already allotted to APC, for access by only those apc_add()/apc_fetch() calls that use reserved space $m.
Obviously apc_create_segment() could return false if it cannot claim that amount of space from the global pool. The tradeoff here is that you're reserving a portion of the shared memory available to APC from the start, but in exchange you can prevent certain variables from growing unbounded until reaching APC's global limit. You'd use this only when you expect you'll actually use the amount of space you're reserving, at which point you can fall back on a database fetch, etc. until part of memory segment $m is freed up again.