Physical memory, virtual memory, buffers, cached, shared memory, swap

Source: Internet
Author: User

Physical Memory:

The actual memory used;

Virtual Memory:

Virtual memory is a logical memory space concept designed by the operating system kernel in order to manage the process address space (management). The pointers in our program are actually the addresses in this virtual memory space. For example, after we have written a C + + program, we need to use g++ to compile, when the compiler adopts the address is actually the virtual memory space address . Because the program is not running yet, what about the physical memory space address? any instruction or data that may need to be used in the course of running the program must be in the virtual memory space . Since virtual memory is a logical (false) memory space, in order for the program to run on a physical machine, there must be a mechanism to map the imaginary virtual memory space to the physical memory space (the real space on the RAM memory bar ). This is actually what the page table in the operating system does. The kernel maintains a separate page mapping table for each process in the system . The basic principle of a page map is to map a piece of virtual memory space that needs to be accessed during a program's run through a page map to a physical memory space, so that the CPU accesses the corresponding virtual memory address by using the mechanism of the Lookup page mapping table to access a corresponding address on the physical memory. Page is the basic unit of virtual memory space mapping to physical memory space.

Shared Memory:

Portions of memory shared between multiple processes, such as public library libc.so, etc.

Swap partition, interactive memory:

Interactive partitions are hard disk space and are used as temporary memory when memory is low

The main function of swap is that when the entity memory is not enough, some of the programs in memory are temporarily moved to swap, allowing the entity memory to be used by the required program. In addition, if your host supports power management mode, that is, your Linux host system can enter the "hibernate" mode, then, the running state of the program will be recorded to swap, as the "Wake Up" host State basis! In addition, there are some programs at runtime that would have used the swap feature to hold some data segments, so swap is needed to create! Just don't need too much!


Buffer is the data that the cache will put on the hard drive

Cache is cached data read from the hard disk

Disk.  Use.  

From: http://blog.csdn.net/rebirthme/article/details/50402082

http://blog.51cto.com/frankch/1862697

Physical memory, virtual memory, buffers, cached, shared memory, swap

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.