You have 3 sorts of memory: flash (for programs), RAM (for variables) and EEPROM (for 'saved' variables).
The EEPROM on the Uno is only 1 Kb (1024 bytes). Under the default settings the EEPROM is preserved when you load new sketches. The RAM isn't.
You may possibly be better off investigating an SD card solution - there are various ways you can connect up a standard SD (or mini SD) card, that gives you a lot more storage.