Memory/Manager.php

Show: PublicProtectedPrivateinherited
Table of Contents
Zend Framework
LICENSE This source file is subject to the new BSD license that is bundled with this package in the file LICENSE.txt. It is also available through the world-wide-web at this URL: http://framework.zend.com/license/new-bsd If you did not receive a copy of the license and are unable to obtain it through the world-wide-web, please send an email to license@zend.com so we can send you a copy immediately.
Category
Zend  
Copyright
Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  
Package
Zend_Memory  
Version
$Id$  

\Zend_Memory_Manager

Package: Zend_Memory
Memory manager
This class encapsulates memory menagement operations, when PHP works in limited memory mode.
Category
Zend  
Copyright
Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  

Properties

>VPropertyprivate\Zend_Cache_Backend_Interface $_backend = null
Object storage backend
Default valuenullDetails
Type
\Zend_Cache_Backend_Interface
>VPropertyprivate\Zend_Memory_Container_Movable $_lastModified = null
Last modified object
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
Default valuenullDetails
Type
\Zend_Memory_Container_Movable
>VPropertyprivateinteger $_managerId
Unique memory manager id
Details
Type
integer
>VPropertyprivateinteger $_memoryLimit = -1
Memory grow limit.
Default value is 2/3 of memory_limit php.ini variable Negative value means no limit
Default value-1Details
Type
integer
>VPropertyprivateinteger $_memorySize = 0
Overall size of memory, used by values
Default value0Details
Type
integer
>VPropertyprivateinteger $_minSize = 16384
Minimum value size to be swapped.
Default value is 16K Negative value means that memory objects are never swapped
Default value16384Details
Type
integer
>VPropertyprivateinteger $_nextId = 0
Id for next Zend_Memory object
Default value0Details
Type
integer
>VPropertyprivatearray $_sizes = array()
List of object sizes.
This list is used to calculate modification of object sizes array( => , ...)
Default valuearray()Details
Type
array
>VPropertyprivatearray $_tags
Tags array, used by backend to categorize stored values
Details
Type
array
>VPropertyprivatearray $_unloadCandidates = array()
List of candidates to unload
It also represents objects access history. Last accessed objects are moved to the end of array array( => , ... )
Default valuearray()Details
Type
array

Methods

methodpublic__construct(\Zend_Cache_Backend $backend = null) : void

Memory manager constructor

If backend is not specified, then memory objects are never swapped
Parameters
NameTypeDescription
$backend\Zend_Cache_Backend
methodpublic__destruct() : void

Object destructor

Clean up backend storage
methodprivate_commit() : void

Commit modified object and put it back to the loaded objects list

methodprivate_create(string $value, boolean $locked) : \Zend_Memory_Container_Interface

Create new Zend_Memory object

Parameters
NameTypeDescription
$valuestring
$lockedboolean
Returns
TypeDescription
\Zend_Memory_Container_Interface
Throws
ExceptionDescription
\Zend_Memory_Exception
methodprivate_generateMemManagerId() : void

This function is intended to generate unique id, used by memory manager

methodprivate_swap(\Zend_Memory_Container_Movable $container, integer $id) : void

Swap object data to disk Actualy swaps data or only unloads it from memory, if object is not changed since last swap

Parameters
NameTypeDescription
$container\Zend_Memory_Container_Movable
$idinteger
methodprivate_swapCheck() : void

Check and swap objects if necessary

Throws
ExceptionDescription
\Zend_MemoryException
methodpubliccreate(string $value = '') : \Zend_Memory_Container_Interface

Create new Zend_Memory value container

Parameters
NameTypeDescription
$valuestring
Returns
TypeDescription
\Zend_Memory_Container_Interface
Throws
ExceptionDescription
\Zend_Memory_Exception
methodpubliccreateLocked(string $value = '') : \Zend_Memory_Container_Interface

Create new Zend_Memory value container, which has value always locked in memory

Parameters
NameTypeDescription
$valuestring
Returns
TypeDescription
\Zend_Memory_Container_Interface
Throws
ExceptionDescription
\Zend_Memory_Exception
methodpublicgetMemoryLimit() : integer

Get memory grow limit

Returns
TypeDescription
integer
methodpublicgetMinSize() : integer

Get minimum size of values, which may be swapped

Returns
TypeDescription
integer
methodpublicsetMemoryLimit(integer $newLimit) : void

Set memory grow limit

Parameters
NameTypeDescription
$newLimitinteger
Throws
ExceptionDescription
\Zend_Exception
methodpublicsetMinSize(integer $newSize) : void

Set minimum size of values, which may be swapped

Parameters
NameTypeDescription
$newSizeinteger
Documentation was generated by phpDocumentor 2.2.0 .