Memory manager
This class encapsulates memory menagement operations, when PHP works in limited memory mode.
package | Default |
---|
__construct(\Zend\Cache\Storage\StorageInterface $cache = null
)
If cache is not specified, then memory objects are never swapped
\Zend\Cache\Storage\StorageInterface
__destruct()
Clean up cache storage
create(string $value = ''
) : \Zend\Memory\Container\ContainerInterface
string
\Zend\Memory\Exception\ExceptionInterface |
---|
\Zend\Memory\Container\ContainerInterface
createLocked(string $value = ''
) : \Zend\Memory\Container\ContainerInterface
string
\Zend\Memory\Exception\ExceptionInterface |
---|
\Zend\Memory\Container\ContainerInterface
getMemoryLimit() : integer
integer
getMinSize() : integer
integer
setMemoryLimit(integer $newLimit)
integer
setMinSize(integer $newSize)
integer
_create(string $value, boolean $locked) : \Zend\Memory\Container\ContainerInterface
string
boolean
\Zend\Memory\Exception\ExceptionInterface |
---|
\Zend\Memory\Container\ContainerInterface
commit()
generateMemManagerId()
swap(\Zend\Memory\Container\Movable $container, integer $id)
\Zend\Memory\Container\Movable
integer
swapCheck()
\Zend\Memory\Exception\RuntimeException |
---|
$cache : \Zend\Cache\Storage\StorageInterface
null
$lastModified : \Zend\Memory\Container\Movable
null
It's used to reduce number of calls necessary to trace objects' modifications Modification is not processed by memory manager until we do not switch to another object. So we have to trace only first object modification and do nothing for others
$managerId : integer
$memoryLimit : integer
-1
Default value is 2/3 of memory_limit php.ini variable Negative value means no limit
$memorySize : integer
0
$minSize : integer
16384
Default value is 16K Negative value means that memory objects are never swapped
$nextId : integer
0
$sizes : array
array()
This list is used to calculate modification of object sizes
array(
$unloadCandidates : array
array()
It also represents objects access history. Last accessed objects are moved to the end of array
array(