Small valley bottom aggregate
Memory five areas
-
- In iOS development, it’s common for people to say,
The heap area
.The stack area
All existVirtual memory
. Today we talk about a wave of existenceVirtual memory
The five regions
- In iOS development, it’s common for people to say,
-
- The five areas of memory include:
The heap area
,The stack area
,The global area
,The constant area
,Code section
- The five areas of memory include:
-
- Here’s a graphic:
1.1. The stack area
The stack area
Allocated and released by the compiler to store temporarily created functions, local variables, etc. It’s a contiguous memory space. (Because the stack area is relatively small, so it is valuable)
1.2. The heap area
The heap area
Allocated and released by the programmer. Stores memory segments that are dynamically allocated while running. Memory areas in the heap are not contiguous (similar to a linked list structure). Therefore, memory fragmentation is easy to occur.
1.3. Global static zone
Global static region
Memory space allocated at compile time. Data in this memory remains during the execution of the program and is released by the system after the program ends
1.4. The constant area
The constant area
Memory space allocated at compile time and released by the system at the end of the program. It’s a constant, it’s a special area
1.5. The code area
Code section
Binary code for storing functions (read only)