Menu

## MemoryPeakUsageProcessor extends MemoryProcessor
in package

MemoryPeakUsageProcessor.php : 20

Injects memory_get_peak_usage in all records

##### Tags

see
  MemoryProcessor::__construct()

  for options

author

  Rob Jensen

### Table of Contents

$realUsage : bool
$useFormatting : bool
__construct() : mixed
__invoke() : array<string|int, mixed>
formatBytes() : string|int
  Formats bytes into a human readable string if $this->useFormatting is true, otherwise return $bytes as is

### Properties

#### $realUsage

MemoryProcessor.php : 24
`protected bool $realUsage`

If true, get the real size of memory allocated from system. Else, only the memory used by emalloc() is reported.

#### $useFormatting

MemoryProcessor.php : 29
`protected bool $useFormatting`

If true, then format memory size to human readable string (MB, KB, B depending on size)

### Methods

#### __construct()

MemoryProcessor.php : 35
`public __construct([bool $realUsage = true ][, bool $useFormatting = true ]) : mixed`

##### Parameters

$realUsage : bool = true

  Set this to true to get the real size of memory allocated from system.

$useFormatting : bool = true

  If true, then format memory size to human readable string (MB, KB, B depending on size)

##### Return values

mixed —

#### __invoke()

MemoryPeakUsageProcessor.php : 26
`public __invoke(array<string|int, mixed> $record) : array<string|int, mixed>`

##### Parameters

$record : array<string|int, mixed>

##### Return values

array<string|int, mixed> —

#### formatBytes()

MemoryProcessor.php : 47

Formats bytes into a human readable string if $this->useFormatting is true, otherwise return $bytes as is

`protected formatBytes(int $bytes) : string|int`

##### Parameters

$bytes : int

##### Return values

string|int —

Formatted string if $this->useFormatting is true, otherwise return $bytes as is

## Search results