Article Title: Linux memory monitoring virtual memory implementation mechanism and capacity settings. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
In address ing, you need to use TLB (translation back-to-back storage) to find physical pages. The swap cache is also used in the SWAP mechanism, after switching the physical page content to the switch document, you must modify the page table to map the document address.
(1) Linux memory monitoring virtual memory Implementation Mechanism
Linux memory monitoring Linux virtual memory requires six mechanisms: Address ing, memory allocation and recovery, cache and refresh, request page, swap, and Memory Sharing.
First, the memory management program maps the Logical Address of the user program to the physical address through the ing mechanism. When the user program runs, if the virtual address used in the program does not have the corresponding physical memory, the request page needs to be sent; if there is idle memory available for allocation, the memory will be requested to be allocated (so the memory is allocated and recycled ), and record the physical pages in use in the cache (the cache mechanism is used ). If there is not enough memory for allocation, call the swap mechanism to free up some memory. In addition, in address ing, you need to use TLB (translation back-to-back storage) to find physical pages. In the switching mechanism, the swap cache is also used, after switching the physical page content to the switch document, you must modify the page table to map the document address.
(2) Linux memory monitoring virtual memory capacity settings
Someone may tell you that you should allocate 2 times the virtual memory of the physical memory, but this is an unfixed rule. If your physical storage is small, you can set it like this. If you have 1 GB physical memory or more, you can reduce the virtual memory. Linux uses a large amount of memory for Cache, but recycles it when resources are insufficient .. As long as you see that swap is 0 or very small, you can rest assured, because the memory is not used is the biggest waste.