Small valley bottom aggregate

Memory five areas

    1. In iOS development, it’s common for people to say,The heap area.The stack areaAll existVirtual memory. Today we talk about a wave of existenceVirtual memoryThe five regions
    1. The five areas of memory include:The heap area,The stack area,The global area,The constant area,Code section
    1. Here’s a graphic:

1.1. The stack area

  • The stack areaAllocated 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 areaAllocated 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 regionMemory 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 areaMemory 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 sectionBinary code for storing functions (read only)