Page replacement algorithm (best permutation algorithm, FIFO permutation algorithm, LRU permutation algorithm, lfu permutation algorithm)

Source: Internet
Author: User

Page substitution occurs because of paged-request storage management, which is one of the ways to implement virtual storage management, where one feature is multiple--and multiple times the page is swapped in or out of memory.

Best-performing page replacement algorithm: the best permutation algorithm

The more commonly used page substitution algorithms are: FIFO permutation algorithm, LRU permutation algorithm, LFU permutation algorithm

Best permutation algorithm: Impossible---is the method of measuring other permutation algorithms.

FIFO permutation algorithm: first-in-one-out permutation algorithm to eliminate the first page to enter memory, that is, choose the most in memory to reside in the longest page to be eliminated. (Simple Implementation)

LRU permutation algorithm: The most recent unused permutation algorithm, the algorithm gives each page an Access field to record a page since the last time it has been visited by the T, when a page must be eliminated, select the existing page of the largest t value, that is, the most recent unused page is eliminated.

LFU Replacement algorithm: Use the least displacement algorithm and select the least used page in recent times as the elimination page.

Here is an example of each algorithm description

Assuming that a process has 8 pages, the system allocates three physical blocks. and consider having the following page number reference string: 7,0,1,2,0,3,0,4,2,3,0,3,2,1,2,0,1,7,0,1

Optimal permutation algorithm:

FIFO permutation algorithm:

LRU Permutation algorithm:

LFU permutation algorithm:

Page replacement algorithm (best permutation algorithm, FIFO permutation algorithm, LRU permutation algorithm, lfu permutation algorithm)

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.