Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
|
Public Member Functions | |
__construct (\Magento\Framework\Shell $shell) | |
getRealMemoryUsage () | |
Static Public Member Functions | |
static | convertToBytes ($number) |
static | isMacOs () |
Data Fields | |
const | MEMORY_UNITS = 'BKMGTPE' |
Protected Member Functions | |
_getUnixProcessMemoryUsage ($pid) | |
_getWinProcessMemoryUsage ($pid) | |
Static Protected Member Functions | |
static | _convertToNumber ($number) |
Definition at line 13 of file Memory.php.
__construct | ( | \Magento\Framework\Shell | $shell | ) |
Inject dependencies
\Magento\Framework\Shell | $shell |
Definition at line 33 of file Memory.php.
|
staticprotected |
Remove non-numeric characters in the string to cast it to a numeric value
Incoming number can be presented in arbitrary format that depends on locale. We don't possess locale information. So the best can be done is to treat number as an integer and eliminate delimiters. Method will not behave correctly with non-integer numbers for the following reason:
$number |
Definition at line 139 of file Memory.php.
|
protected |
Retrieve the current process' memory usage using Unix command line interface
int $pid int Memory usage in bytes
Definition at line 67 of file Memory.php.
|
protected |
Retrieve the current process' memory usage using Windows command line interface
int $pid int Memory usage in bytes
Definition at line 87 of file Memory.php.
|
static |
Convert a number optionally followed by the unit symbol (B, K, M, G, etc.) to bytes
string | $number | String representation of a number |
Definition at line 104 of file Memory.php.
getRealMemoryUsage | ( | ) |
Retrieve the effective memory usage of the current process
memory_get_usage() cannot be used because of the bug int Memory usage in bytes
Definition at line 46 of file Memory.php.
|
static |
Whether the operating system belongs to the Mac family
Definition at line 156 of file Memory.php.
const MEMORY_UNITS = 'BKMGTPE' |
Prefixes to specify unit of measure for memory amount
Warning: it is important to maintain the exact order of letters in this literal, as it is used to convert string with units to bytes
Definition at line 21 of file Memory.php.