update memory management.