/**
* Tests whether we've exceeded the desired memory threshold.
*
* If so, output a message.
*
* @return bool
* TRUE if the threshold is exceeded, otherwise FALSE.
*/
protected function memoryExceeded() { $usage =
$this->
getMemoryUsage();
$pct_memory =
$usage /
$this->memoryLimit;
if (!
$threshold =
$this->memoryThreshold
) { return FALSE;
} if ($pct_memory >
$threshold) { $this->message->
display( $this->
t( 'Memory usage is @usage (@pct% of limit @limit), reclaiming memory.',
[ '@pct' =>
round($pct_memory * 100
),
'@usage' =>
$this->
formatSize($usage),