Re: multiple segments of shared memory?

[email protected] (Alexander Romanovich) Tue, 8 Feb 2011 13:04:51 -0500
Newsgroups php.apc.dev
Message-ID <2011020813045122051-alex@whitewhalenet>
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.