update memory structure