Linux memory monitoring virtual memory

Source: Internet
Author: User

The implementation of Linux virtual memory requires support of six mechanisms: Address ing mechanism, memory allocation and recycling mechanism, cache and refresh mechanism, request page mechanism, swap mechanism, and Memory sharing mechanism.

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.