====== Ethereum Memory ====== [[dido:public:ra:xapend:xapend.a_glossary:start| Return to Glossary ]] **Ethereum Memory** (or **Memory**) is a byte-array. Memory starts off zero-size, but can be expanded in 32-byte chunks by simply accessing or storing memory at indices greater than its current size. Since memory is contiguous, it does save gas to keep it packed and shrink its size, instead of having large patches of zeros. It's cheaper to have an array of length 2 storing 2 values, than an array of length 1000 where the values are at the ends of the array and the middle is all zeros. See: [[dido:public:ra:xapend:xapend.a_glossary:e:ethereum_storage]] Source: [[https://ethereum.stackexchange.com/questions/1232/difference-between-memory-and-storage/1235 ]] /**=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- /* To add a discussion page to this page, comment out the line that says ~~DISCUSSION:off~~ */ ~~DISCUSSION:on|Outstanding Issues~~ ~~DISCUSSION:off~~