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

Page allocation strategy: resident set size, opportunities to access the page, and where to transfer the page

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

Share

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

Resident set size

With regard to paged virtual memory, when preparing for implementation, it is not necessary to be able to read all pages of a process to main memory, so the operation must decide to read several pages. In other words, how much main memory space is allocated to a particular process needs to consider the following points:

The smaller the amount of storage allocated to a process, the more processes will reside in the main memory at any time, thus improving the application effectiveness of the processor.

If a process has too few pages in main memory, although there is some sexual truth, the page hair rate will still be absolutely high.

For example, if there are too many desk pages, because of part of the sexual reason, allocating more main storage space to a particular process has no clear effect on the hairiness rate of the process.

Based on these elements, there were three strategies for piecemeal operations in ancient times:

Fixed dispatch and partial replacement. It allocates a certain number of physical blocks to each process and remains unchanged for all periods of operation. If a page fault occurs while the process is running, only one page can be selected from the memory page of the process, and then the required page can be called. To accomplish this strategy, it is difficult to determine the number of physical blocks that should be allocated for each process: too few will often show missing page suffixes, and too much will reduce the application rate of CPU and other capital.

Variable dispatch global replacement. This is the easiest physical block allocation and replacement strategy to complete, assigning a certain number of physical blocks to each process in bits and pieces, and operating the piecemeal itself adheres to a queue of leisure physical blocks. When a page fault occurs in a process, a physical block is taken out of the queue of leisure physical blocks to assign to the process, and the page to be called is loaded into it.

Variable dispatch partial replacement. It allocates a certain number of physical blocks to each process, and when a process has a page fault, only one page is allowed to be selected from the memory page of the process, so that the operation of other processes will not be affected. If the process frequently lacks pages in operation, a number of physical blocks are assigned to the process until the missing page rate of the process tends to an appropriate level; on the contrary, if the missing page rate of the process is particularly low in operation, the physical blocks assigned to the process can be appropriately increased.

The opportunity to transfer to the page

To affirm the opportunity to transfer pages missing while the process is running into memory on a piecemeal basis, you can adopt the following two paging strategies:

Preset page strategy. In part, it can be more efficient to call in several adjacent pages at a time than one page at a time. However, if most of the pages transferred in are not visited, it is inefficient. So the demand for a preset page strategy based on guesswork is to transfer pages that are expected to be visited in the near future into memory. But the winning rate of the preset page is only about 50%. Therefore, when this strategy is mainly used for the first call in the process, it is up to the programmer to indicate which pages should be called first.

Plead for paging strategy. When the process is running, the pages that need to be visited are not in memory, and the required pages are called into memory in bits and pieces. The pages transferred by this strategy are bound to be visited, and this strategy is easier to complete, so this strategy is mostly used in today's virtual memory. Its drawback is that it only calls in one page at a time, and too many pages will cost too much money.

Where to call in the page

The external memory in the pagination bits and pieces is divided into two parts: the file area used to store the file and the swap area used to host the swap page. On weekdays, the continuous distribution method is used for the adjustment area, while the reunion distribution method is used for the file area, so the speed of the disk Imax O of the adjustment area is faster than that of the file area. There are three situations in which to transfer the page from:

Bits and pieces have enough space for the adjustment area: you can all call in the required pages from the adjustment area to improve the paging speed. For this reason, the files related to the process need to be copied from the file area to the adjustment area before the process runs.

Bits and pieces are short and enough adjustment area space: all files that will not be corrected are transferred directly from the file area, and when swapping out these pages, they do not have to be swapped out because they have not been corrected. However, for those parts that can be modified, they must be transferred to the adjustment area when they are swapped out, and then transferred in from the adjustment area when needed in the future.

UNIX method: files related to the process are placed in the file area, so pages that have not been run should be transferred from the file area. Pages that have been run but have been swapped out, because they are placed in the adjustment area, should be transferred in from the adjustment area next time. If the shared page requested by the procedure is called into memory by another process, there is no need to call in from the adjustment area.

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