update memory.