Variables will occasionally flush to disk. But if you want to keep things in memory for longer, you can use hash tables.