Memory limit is a number of bytes allowed to be used by loaded movable objects.
If loading or creation of an object causes memory usage to exceed of this limit, then the memory manager swaps some other objects.
You can retrieve or set the memory limit setting using the
getMemoryLimit() and
setMemoryLimit($newLimit) methods:
<?php
$oldLimit = $memoryManager->getMemoryLimit(); // Get memory limit in bytes
$memoryManager->setMemoryLimit($newLimit); // Set memory limit in bytes
A negative value for memory limit means 'no limit'.
The default value is two-thirds of the value of 'memory_limit' in php.ini or 'no limit' (-1) if 'memory_limit' is not set in php.ini.
MinSize is a minimal size of memory objects, which may be swapped by memory manager. The memory manager does not swap objects that are smaller than this value. This reduces the number of swap/load operations.
You can retrieve or set the minimum size using the
getMinSize() and
setMinSize($newSize) methods:
<?php
$oldMinSize = $memoryManager->getMinSize(); // Get MinSize in bytes
$memoryManager->setMinSize($newSize); // Set MinSize limit in bytes
The default minimum size value is 16KB (16384 bytes).




