Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

The concept and characteristics of virtual memory and the completion of virtual memory

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Network Security >

Share

Shulou(Shulou.com)06/01 Report--

Characteristics of traditional storage governance methods

Most of the memory governance strategies discussed in the previous section are designed to keep multiple processes in memory at the same time to allow multiprogramming. They all have the following two characteristics:

1) one-time

Homework must be loaded into memory all at once before it can start running. This can lead to two conditions:

It is considered that the work is so big that when all of them are loaded into memory, the homework will not work.

When a small number of homework requests run, because of the lack of memory to contain all the homework, most of the homework can only be run first, resulting in a reduction in the degree of multi-programming.

2) resident

After the homework is loaded into memory, it continues to stay in memory, and no part of it will be swapped out until the homework is finished. The process in operation will be choked up due to waiting for Iripple O, and can be in a temporary waiting state.

As can be seen from the above analysis, many programs (data) that are unnecessary or temporarily unnecessary in the operation of the program occupy a small amount of memory space, while some homework that requires operation can not be loaded and run, which obviously wastes precious memory capital.

Part of the sexual truth

To really understand the idea of virtual memory techniques, you must first understand some of the well-known sexual truths in computers. The famous Bill 喜悦 (CEO of SUN company) said: "in the research institute, I used to joke that caching was the only major idea in the computer superstition. In fact, the fast cache technique did greatly affect the piecemeal design of the computer." Fast table, page cache and virtual memory skills belong to cache skills in a narrow sense. The truth attached to this technique is part of the sexual truth. Part of the sexual truth applies to both program construction and data construction (further, Dijkstra's famous paper on "goto statements are harmless" is also based on an in-depth view and understanding of the partial nature of the program).

Part of the sexual truth is expressed in the following two aspects:

Time partiality: if an instruction in the program is executed, it can be executed again in the near future; if some data has been visited, it can be visited again in the near future. The typical reason for timing fragmentation is that there are a small number of reincarnation operations in the program.

Spatial partiality: once a program visits a storage unit, the nearby storage unit will also be visited soon, that is, the address visited by the program over a period of time can be concentrated within a certain scale. this is because instructions are usually stored and executed in order, and data is usually stored in clusters in the form of vectors, arrays, tables, and so on.

Time division is done by storing the instructions and data that are about to be used into the cache memory and using the hierarchical structure of the cache. The spatial part is usually completed by using a large cache and integrating the prefetching mechanism into the cache master logic. In practice, the technique of virtual memory is to set up the construction of two-level memory of "memory and external memory", and to complete the fast cache by applying part of the truth.

Definition and characteristics of virtual memory

Based on the partial reason, when the program is loaded, a part of the program can be loaded into memory, while the other part can be left in external memory, the program can be started to perform. In the process of program execution, when the visited information is not in memory, the required part is transferred to memory by the operation, and then the program is executed continuously. On the other hand, the operation swaps the contents that are not temporarily used in the memory to the external memory, thus freeing up space to store the information to be transferred to the memory. In this way, bits and pieces seem to provide users with a memory that is much larger than the practical memory, called virtual memory.

It is called virtual memory because it does not exist in practice, just because bits and pieces provide local loading, pleading, and replacement functions (fully clear to the user). It makes users feel as if there is a memory that is much larger than the actual physical memory. The size of virtual memory is determined by the address of the computer, not by the complex addition of memory and external memory. Virtual storage has the following three secondary features:

Repetition means that there is no need to load the whole into memory at one time when the homework is running, but it is allowed to be transferred into memory again and again.

Tonality means that there is no need to stay in memory while the homework is running, but it is allowed to stop swapping in and out during the operation of the homework.

Virtuality refers to logically expanding the capacity of memory, and the amount of memory seen by users is much higher than that in practice.

The completion of virtual memory skills

In virtual memory, it is allowed to transfer a homework to memory several times. When using the continuous allocation method, a considerable part of the memory space will be in the form of temporary or "eternal" leisure, resulting in a serious waste of memory capital, and can not logically expand the memory capacity. Therefore, the real requirement of virtual memory is based on the memory governance method of reunion allocation. There are three ways to accomplish virtual memory:

Plead for paging storage governance.

Plead for segmented storage governance.

Plead for page-based storage governance.

No matter which method, it requires a certain amount of hardware support. The support of general demand has the following aspects:

A certain amount of memory and memory.

Page table mechanism (or segment table mechanism) as a secondary data construct.

Infix mechanism, when the part to be visited by the user program has not been called into memory, the infix occurs.

Address translation mechanism, the transformation of logical address to physical address.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Network Security

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report