Linux memory management is based on the basic paging mechanism. Some parts of RAM in the linux Kernel will be permanently allocated to the kernel and used to store kernel code and static kernel data structures. The rest of RAM is called dynamic memory, which is not only a valuable resource required by the process, but also a valuable resource required by the kernel itself. In fact, the performance of the entire system depends on how to effectively manage the dynamic memory. Therefore, all multitasking operating systems are now optimized for dynamic memory usage. That is to say, they should be allocated as much as possible and released as needed.
Memory Management is one of the most complex management mechanisms in the OS. Linux uses many effective management methods, including page table management, high-end memory (temporary ing area, fixed ing area, permanent ing area, non-continuous memory area) management, partner systems for external fragment reduction, slab mechanisms for internal fragment reduction, Previous Page distribution systems for partner systems, and emergency memory management. These are analyzed and summarized in detail in the following sections.
This figure shows the linux memory overview.