Virtual Memory Management

Source: Internet
Author: User

1. What is virtual memory

Virtual memory is a technology of computer system memory management. It makes the application think that he has contiguous free memory ( a contiguous, complete address space ), and in fact, he is usually divided into multiple physical memory fragments, and some are temporarily stored on the external disk storage, when needed to exchange data.

Note: Virtual memory is not just about "using disk space to extend physical memory"-this is just an extension of the memory level to include a disk drive, and extending memory to disk is only a result of using virtual memory technology, His role can be achieved by overwriting or switching the inactive programs and their data to disk in the best way possible.

2. Why there is virtual memory

Many years ago, when people are still using DOS or older operating systems, the computer memory is very small, usually in K for the calculation, the corresponding, then the program size is not large, so the memory capacity, although small, but still can accommodate the program at that time. But as the image interface is remembered and the user's needs grow, the scale of the application expands. Finally a problem appears in front of the programmer, that is, the application is too large to fit the memory of the program, usually the solution is to split the program into a lot of fast-covering fragments. Overlay Block 0 runs first, and at the end he will call another overlay block. Although the swap of the overlay block is done by the OS, a programmer's program must first be split, which is a time-consuming and laborious task, and rather dull. Virtual memory is born.

3, Physical address, virtual address, logical address difference

The address bus for 32-bit systems is 32-bit, and the64-bit CPU refers to a universal register within the CPU with a width of 64 bits and a data bus with 64-bit-sensitivity

(1) Virtual address and virtual address space: a continuous and complete space. Virtual memory addresses are address spaces that can be addressed directly by each process, and are not disturbed by other processes. Each instruction and data unit has a definite address in this virtual space.

Virtual memory is the virtual space composed of the target code, data and other virtual address in the process.

How big the virtual address is completely address bus decision, there are how many address bus, there will be 2 of how many times the address.

Virtual address is also a size limit, if a program accounted for 2G of virtual memory, the rest of the program only 2G of virtual memory can be used.

(2) Physical address space and physical address: Physical memory , the actual size of the memory bars plugged into the memory slots of the motherboard.

(3) Logical address: The source code after compiling to form the target code, each target code is 0 for the base Address Book sequence. This generates a target program that occupies a certain address space, called the Job's logical address space, or logical space.

The logical address is for the program, the virtual address is for the operating system, with a logical address, the program can be in their own internal logical location, and then mapped to physical memory can be added to their own logical offset.

With the virtual address, the program has a whole block of virtual memory, the operating system also thinks that the program is loaded in, you can create a process for it.

Virtual Memory Management

Related Article

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.