By the way, are you sure about your formula : 

memory_get_usage() > $this->options->getMaxMemory() * 1024 * 1024

memory_get_usage returns a value in bytes, while max memory in config is KB, so should it be memory_get_usage() * 1024 > $this->options->getMaxMemory() instead ?