Zend\Memory\MemoryManager
Memory manager
This class encapsulates memory menagement operations, when PHP works
in limited memory mode.
Synopsis
class MemoryManager
{
- // members
- private StorageInterface $cache;
- private integer $memoryLimit;
- private integer $minSize;
- private integer $memorySize;
- private integer $nextId;
- private array $unloadCandidates;
- private array $sizes;
- private Movable $lastModified;
- private int $managerId;
- // methods
- private void generateMemManagerId()
- public void __construct()
- public void __destruct()
- public void setMemoryLimit()
- public int getMemoryLimit()
- public void setMinSize()
- public int getMinSize()
- public ContainerInterface create()
- public ContainerInterface createLocked()
- private ContainerInterface _create()
- public null unlink()
- public void processUpdate()
- private void commit()
- private void swapCheck()
- private void swap()
- public void load()
Tasks
Line | Task |
---|---|
112 | !!! |
Members
private
- $cache
—
Zend\Cache\Storage\StorageInterface
Storage cache object - $lastModified
—
\Zend\Memory\Container\Movable
Last modified object - $managerId
—
int
Unique memory manager id - $memoryLimit
—
int
Memory grow limit. - $memorySize
—
int
Overall size of memory, used by values - $minSize
—
int
Minimum value size to be swapped. - $nextId
—
int
Id for next Zend\Memory object - $sizes
—
array
List of object sizes. - $unloadCandidates
—
array
List of candidates to unload
Methods
private
- _create() — Create new Zend\Memory object
- commit() — Commit modified object and put it back to the loaded objects list
- generateMemManagerId() — This function is intended to generate unique id, used by memory manager
- swap() — Swap object data to disk Actually swaps data or only unloads it from memory, if object is not changed since last swap
- swapCheck() — Check and swap objects if necessary
public
- __construct() — Memory manager constructor
- __destruct() — Object destructor
- create() — Create new Zend\Memory value container
- createLocked() — Create new Zend\Memory value container, which has value always locked in memory
- getMemoryLimit() — Get memory grow limit
- getMinSize() — Get minimum size of values, which may be swapped
- load() — Load value from swap file.
- processUpdate() — Process value update
- setMemoryLimit() — Set memory grow limit
- setMinSize() — Set minimum size of values, which may be swapped
- unlink() — Unlink value container from memory manager