Basic management of LINUX (2.0)

Storage management

Memory is divided into internal memory (referred to as memory) and external memory (referred to as external memory). Memory is used to store currently executing program code and data in use. External storage includes hard disks, floppy disks, optical disks, U disks and other devices, and is mainly used to save data. The storage management of the operating system is mainly the management of memory.

Linux adopts virtual storage technology, that is, it provides users with a job address space that is much larger than the actual memory in a transparent way. It is a very large memory logic model. Using the logical address provided by the processor to access virtual memory, users can safely arrange their programs and data in a very large address space, as if they have such a large memory space.

Linux follows a page-based storage management mechanism. Both virtual memory and physical memory are divided in units of pages, and the size of the page is fixed. When it is necessary to transfer the program segment and data in the virtual memory into or out of the physical memory, it is done in units of pages. The relationship between a page in virtual memory and a page in physical memory is stored in the page table. When the physical memory has been fully occupied, and the system needs to transfer that part of the program segment or data in the virtual memory into the memory, linux uses the LRU algorithm (least resently used algorithm, least recently used algorithm) to eliminate the physical memory that has not been accessed recently. page, thereby freeing up memory space to load necessary program segments or data.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325566215&siteId=291194637