What Is a Virtual Memory System?

Virtual memory refers to a software design technique used in computers with insufficient internal memory capacity to provide users with more random access space [1] . A virtual memory system is a program that manages and allocates virtual memory for user programs. The reasons for the emergence of the virtual memory system are the small memory capacity and the principle of program locality.

A virtual memory system refers to a program that manages and allocates the virtual memory of a user program. It has a request-loading function and a replacement function, and can logically expand the memory capacity. Its logical capacity is determined by the sum of memory capacity and external storage capacity. Its operating speed is close to the memory speed, while the cost per bit is close to external storage. The implementation methods of the virtual memory system include a paging request system and a request segmentation system.
(1) One time. In the several storage management methods introduced above, all jobs are required to be loaded into memory before they can be run, that is, jobs must be loaded into memory all at once before running, and it is this feature that has caused the above two situations. happened. In addition, there are many jobs that do not use all their programs and data each time they are run. If you load all of its programs at once, it is also a waste of memory space.
(2) Resident. Once a job is loaded into memory, it stays in memory until the job finishes running. Although the running process will wait for a long time due to I / O, or some program modules are no longer needed (running) after running once, they will still occupy valuable memory resources.
From this, it can be seen that the one-time and resident properties mentioned above cause many programs (data) that are not used or are not used in the program running to occupy a large amount of memory space, so that some jobs that need to run cannot be loaded and run. The question to be studied now is whether one-off and resident are necessary when the program is running.
As early as 1968, Denning.P pointed out that the program will show a local law when it is executed, that is, in a short period of time, the execution of the program is limited to a certain part; accordingly, the storage it accesses Space is also limited to a certain area. He made the following arguments:
(1) When the program is executed, except for a small number of branch and procedure call instructions, it is still executed sequentially in most cases. This argument was also confirmed by many scholars' research on the laws of high-level programming languages (such as FORTRAN language, PASCAL language) and C language.
(2) The procedure call will cause the execution trajectory of the program to be transferred from one area to another, but research shows that the depth of the procedure call does not exceed 5 in most cases. This means that the program will be limited to the scope of these processes for a period of time.
(3) There are many loop structures in the program. Although these are composed of only a few instructions, they will be executed multiple times.
(4) The program also includes many processing of data structures, such as operations on arrays, which are often limited to a small range.
The limitations are also reflected in the following two aspects:
(1) Time limitations. If an instruction in the program is executed, the instruction may be executed again soon; if a data is accessed, the data may be accessed again soon. The typical cause of time limitations is due to the large number of loop operations in the program.
(2) Space limitations. Once a program accesses a certain storage unit, the storage units near it will also be accessed shortly, that is, the addresses accessed by the program over a period of time may be concentrated in a certain range. The typical situation is the program's Sequential execution.

Virtual memory system multiple times

Repeatability means that a job is divided into multiple memory runs, that is, it is not necessary to load all the jobs when the job is running, only the part of the program and data to be run can be loaded into memory; When you want to run to the part of the program that has not been loaded, load it again. Repeatability is the most important characteristic of virtual storage, and it is not available in any other storage management method. Therefore, we can also consider virtual memory as a memory system with multiple characteristics.

Virtual memory system swap

Swapability means that swapping in and out is allowed during the running of the job, that is, during the running of the process, it is allowed to transfer those programs and data that are not in use from the memory to the swap area of the external storage Out), and later transfer them from external storage to memory (change in) when needed; it even allows you to transfer temporarily not running processes to external storage, and then transfer them to memory when they are ready again. Swap in and out can effectively improve memory utilization. It can be seen that the virtual storage has swap characteristics.

Virtual Memory System Virtuality

Virtuality refers to the ability to logically expand the memory capacity so that the memory capacity seen by the user is much larger than the actual memory capacity. This is the most important feature of virtual storage, and it is also the most important goal to achieve virtual storage. It is worth noting that the virtuality is based on repetitiveness and swapping, or only if the system allows the job to be transferred to the memory multiple times, and programs and data not temporarily running in the memory can be changed It is only possible to implement virtual storage when it is on the disk; multiple times and swapping must be based on discrete allocation.

IN OTHER LANGUAGES

Was this article helpful? Thanks for the feedback Thanks for the feedback

How can we help? How can we help?