update change maxMemory to memory