Not all memory is created equal.
stack
, a heap
, registers
, text segments
, memory-mapped registers
, memory-mapped files
, and perhaps nonvolatile RAM
.
Which one you choose to use in a particular situation has implications for what you can store there, how long it remains accessible, and what mechanisms you use to access it.