Hard disk storage and other kinds of storage media are designed to store information in a persistent manner so that even when the computer is switched off, the data will remain on the storage device and can be accessed again when the computer is switched back on. Documents, spreadsheets, and photos are all examples of this kind of data. Often, people store them on persistent storage for safekeeping.
When a user runs a program, however, though the instruction set-the program itself-may be stored on persistent storage, such as a hard disk, the program will not be executed in this memory. For example, the files and data of a word processor application will be installed to a specific folder location on the computer's hard disk storage, but as the program is executed, or is running, the instructions and operations that occur are transferred to system memory, which the computer can access faster and more efficiently. So, when software creates and uses information during the course of its execution, this information is created in system memory and will not be committed to a storage disk unless it is saved.
I use the term "system memory" throughout this book, but in the world of games other kinds of memory can be used instead. System memory is volatile, meaning if the computer were switched off or if there were a power outage, the data would be lost.
Thus, when programmers write a program, they do so with some knowledge that generally it will be executed in system memory. As the program ends, the contents of this memory will be destroyed by the operating system and become vacant to be recycled for use in either another program still being executed or one that is yet to be executed.