What kind of memory?
RAM is a volatile memory technology so will lose its state when you remove power. If you want to preserve state over power / reset cycles you either need (1) a battery backed up RAM with a low power state, or (2) save to flash which you can then restore at boot time.