Stack: Automatically allocated by the system, generally storing function parameter value, local variable value and so on. Automatically created and disposed by the compiler. Its operation is similar to the stack in the data structure, that is, the principle of last-first-out, advanced-out.
For example: Declare a local variable int b in the function, and the system automatically opens up space for B in the stack.
heap: Typically applied by programmers and indicated by size, and eventually released by programmers. If the programmer does not release, the program may end up being recycled by the OS. For the management of the heap area is linked to the management of the list, the operating system has a record of the free memory address of the linked list, when the program allocates memory to receive the application, the operating system will traverse the linked list, traverse to a record memory address is greater than the requested memory of the linked list node, and the node is removed from the list, The memory address recorded by the node is then assigned to the program.
Global zone/Static zone: As the name implies, global variables and static variables are stored in this area. Only initialized global variables and static variables are stored in a block, and uninitialized global variables and static variables are stored in a block. Released by the system after the program is finished.
Literal constant area: This area mainly stores string constants. Released by the system after the program is finished.
Program code area: This area mainly stores the binary code of the function body.
IOS Miscellaneous Pen-17 (heap area stack, etc.)