OS - Virtual Memory

1.  Virtual memory terminology

Virtual Memory

The address used by the program to refer to the memory is different from the address used by the memory system to identify the physical storage site, and the address generated by the program is automatically converted into machine instructions.

The size of virtual memory is limited by the addressing mechanism and the amount of spare memory available, not by the actual number of memory storage locations.

virtual address An address assigned to a location in virtual memory makes that location accessible as if it were part of main memory.
virtual address space virtual storage allocated to the process
address space range of memory addresses available for a short name
real address The address of the storage location in memory

2. The portion of memory that is in memory at any time during the execution of a process is called the resident set of the process .

  Since a process value can be executed in memory, this memory is called real memory , or real memory for short. But what the programmer or user feels is a larger memory, usually it is allocated on the disk, which is called virtual memory , or virtual memory for short.

3. The meaning of virtual memory: Segmentation allows programmers to view memory as consisting of multiple address spaces or segments, which are unequal in size and dynamic. A memory access consists of an address in the form of a segment number and an offset.  

4. Linux memory management  

   For virtual memory addressing, Linux uses a three-level page table structure:

    1) Page directory, an active process has a page directory, and the page directory is one page size. Also each entry in the table of contents only wants to page a page in the middle table of contents. The page directory for each active process must be in memory.

    2) Page intermediate directory, the page intermediate directory can span multiple pages. Each entry in the page intermediate directory points to a page in the page table.

    3) Page tables, page tables can also span multiple pages. Each page table entry points to a virtual page for the process.

   Kernel memory allocation

   The Linux kernel memory manages physical memory page frames, and its main function is to allocate and reclaim page frames for specific uses.

   Possible owners of page frames include user-space processes, dynamically allocated kernel data, static kernel code, and page buffers.

   The basis of kernel allocation is the page allocation mechanism for user virtual memory management.

 

http://my.oschina.net/leaynOntheroad/blog/165327

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326848496&siteId=291194637