1.6.1. Static Memory

Static memory is actually a collective term. It refers to several closely related regions in the compiled program file. When the program runs, these regions are automatically loaded into memory.

Values in static memory live for the entire duration of the program.

The program’s static memory contains the binary code of the program itself, which is usually mapped as read-only. As the program executes, it walks through the binary instructions in the text segment one by one, and jumps when a function is called.

Static memory holds the memory for variables declared with static, as well as some constant values, such as strings.