This is going to fail if the `memory` is `None` (i.e. max memory detection failed)