protected function memoryExceeded()
    {
        static $warning_percent = 0.5;

        $percent = (memory_get_usage() / 1024 / 1024) / $this->memoryLimit;

        if ($percent >= $warning_percent) {
            $this->log(sprintf('Memory usage at %d%% (Max %s MB)', round($percent * 100, 1), $this->memoryLimit), Logger::DEBUG);
            $warning_percent = ceil(($percent * 100) / 10) * 10 / 100;
        }

        return $percent > 0.999;
    }