ALL > Computer and Education > courses > university courses > undergraduate courses > Operating System > ZSTU-(2020-2021)-1 > online discussion >
online discussion-10 Version 0
👤 Author: by writer 2020-12-08 04:16:20
Discuss situations under which the least frequently used page-replacement algorithm generates fewer page faults than the least recently used page-replacement algorithm. Also discuss under what circumstance the opposite holds.

Please login to reply. Login

kagenzaclaudiengmailcom • 2020-12-08 13:37:13
<a href="http://www.yvsou.com/wp-content/uploads/sites/30/2020/12/56688B67-7229-4FE5-A20B-3AAA971B4F95.png"><img class="alignnone size-medium wp-image-9073" src="http://www.yvsou.com/wp-content/uploads/sites/30/2020/12/56688B67-7229-4FE5-A20B-3AAA971B4F95-300x42.png" alt="" width="300" height="42" /></a> <a href="http://www.yvsou.com/wp-content/uploads/sites/30/2020/12/9E0B685B-AB01-4D3C-87F1-F6EB817ACF41.png"><img class="alignnone size-medium wp-image-9074" src="http://www.yvsou.com/wp-content/uploads/sites/30/2020/12/9E0B685B-AB01-4D3C-87F1-F6EB817ACF41-300x42.png" alt="" width="300" height="42" /></a> <a href="http://www.yvsou.com/wp-content/uploads/sites/30/2020/12/F5BFAF19-1B87-42D3-915F-1A19A27A91BF.png"><img class="alignnone size-medium wp-image-9075" src="http://www.yvsou.com/wp-content/uploads/sites/30/2020/12/F5BFAF19-1B87-42D3-915F-1A19A27A91BF-300x178.png" alt="" width="300" height="178" /></a> <a href="http://www.yvsou.com/wp-content/uploads/sites/30/2020/12/F1F8BC5B-CFCC-4863-A343-14F6962EF32C.png"><img class="alignnone size-medium wp-image-9076" src="http://www.yvsou.com/wp-content/uploads/sites/30/2020/12/F1F8BC5B-CFCC-4863-A343-14F6962EF32C-300x87.png" alt="" width="300" height="87" /></a> <a href="http://www.yvsou.com/wp-content/uploads/sites/30/2020/12/FED5C01F-9BA7-416E-B2FA-F7E89D4F7F3D.png"><img class="alignnone size-medium wp-image-9077" src="http://www.yvsou.com/wp-content/uploads/sites/30/2020/12/FED5C01F-9BA7-416E-B2FA-F7E89D4F7F3D-300x178.png" alt="" width="300" height="178" /></a> <a href="http://www.yvsou.com/wp-content/uploads/sites/30/2020/12/E69AE910-70F2-4556-8D31-5B18133CF4B4.png"><img class="alignnone size-medium wp-image-9078" src="http://www.yvsou.com/wp-content/uploads/sites/30/2020/12/E69AE910-70F2-4556-8D31-5B18133CF4B4-300x84.png" alt="" width="300" height="84" /></a> PostVer 0

Please login to reply. Login

wx287_oz26ft1wt2_isbggtha4lgepaasa • 2020-12-08 14:17:41
<a href="http://www.yvsou.com/wp-content/uploads/sites/30/2020/12/Screenshot_20201208-142027_Chrome.jpg"><img class="alignnone size-medium wp-image-9084" src="http://www.yvsou.com/wp-content/uploads/sites/30/2020/12/Screenshot_20201208-142027_Chrome-202x300.jpg" alt="" width="202" height="300" /></a><a href="http://www.yvsou.com/wp-content/uploads/sites/30/2020/12/Screenshot_20201208-142052_Chrome.jpg"><img class="alignnone size-medium wp-image-9085" src="http://www.yvsou.com/wp-content/uploads/sites/30/2020/12/Screenshot_20201208-142052_Chrome-300x298.jpg" alt="" width="300" height="298" /></a> PostVer 0

Please login to reply. Login

yeqirunoutlookcom • 2020-12-08 14:32:24
Consider the sequence in a system that holds four pages in memory:1 2 3 4 4 4 5 1.The most frequently used page replacement algorithm evicts page4 while fetching page5, while the LRU algorithm evicts page 1. This is unlikely to happen much in practice. For the sequence 1 2 3 4 4 4 5 1 the LRU algorithm makes the right decision. PostVer 0

Please login to reply. Login

yeqirunoutlookcom • 2020-12-08 14:38:51
The lru algorithm needs hardware supports, which can record the physical frame situation. PostVer 0

Please login to reply. Login

1224532347qqcom • 2020-12-08 14:38:21
&nbsp;

(1) LFU is the least frequently used page replacement algorithm, which uses the locality principle to infer the future behavior according to the past page access history of a job in the execution process. It believes that pages that have not been visited in the past may not be visited again in the near future. Therefore, the essence of this algorithm is: when a page needs to be eliminated, the page that has not been used for the longest time in the recent period is always selected to be eliminated.

(2) LRU is the least recently used algorithm, which uses the locality principle to infer the future behavior according to the past page access history of a job in the execution process. It believes that pages that have not been visited in the past may not be visited again in the near future. Therefore, the essence of this algorithm is: when a page needs to be eliminated, the page that has not been used for the longest time in the recent period is always selected to be eliminated.

Case 1: therefore, when the page error generated by LFU is smaller than that generated by LRU, it can only be realized when the page with short time and the least number of visits has only one page

Case 2: when the page error of LRU is less than that of LFU, only when LRU is approximately in ideal condition, that is, "every page swapped out is the latest page to be used among all memory pages". In this way, page swapping can be delayed to the maximum extent. This algorithm is also called ideal page replacement algorithm<a href="http://www.yvsou.com/wp-content/uploads/sites/30/2020/12/casse.png"><img class="alignnone size-medium wp-image-9087" src="http://www.yvsou.com/wp-content/uploads/sites/30/2020/12/casse-300x47.png" alt="" width="300" height="47" /></a> PostVer 0

Please login to reply. Login

804824950qqcom • 2020-12-08 14:54:44
LRU is the least recently used page replacement algorithm (Least Recently Used), that is, the first page that has not been used for the longest time is eliminated!

LFU is the least frequently used page replacement algorithm (Least Frequently Used), that is, the page that has been visited the least in a certain period of time is eliminated

The key to LRU is to see the length of time from the last time the page was used to the occurrence of scheduling;

The key to LFU is to see how often the page is used in a certain period of time PostVer 0

Please login to reply. Login

2031115154qqcom • 2020-12-08 16:36:56
The key to the LRU replacement algorithm is to look at the time from the last time the page was used to the replacement moment. The longer the time, the more likely the page will be replaced. If there have more circumstances which the page that has just been used is used again quickly, it may be better to use the LRU replacement algorithm. For example, the recently loaded map files in the game will continue to be used frequently, It may be better to use LRU replacement algorithm.

The key of LFU replacement algorithm is to look at the frequency of pages used in a certain period of time. The lower the frequency of use, the more likely it is to be replaced. If there has a long reference string and fewer frames, but one or several pages are used at intervals slightly larger than the number of frames. In this case, if the LRU replacement algorithm is used, the above mentioned pages are likely to be replaced frequently due to the small number of frames. However, the total number of times these pages are used is large and will be reused at a similar frequency in the future ,so it may be better to use the LFU algorithm, but the LFU replacement algorithm consumes more CPU resources than the LRU replacement algorithm, so it has a trade-off consideration. PostVer 0

Please login to reply. Login

512858048qqcom • 2020-12-08 16:48:06
LRU is the least recently used page replacement algorithm, that is to eliminate the longest unused pages first; LFU is the least frequently used page replacement algorithm recently, that is to eliminate the pages with the least number of visits in a certain period of time.For example, the period T of the second method is 10 minutes. If page paging is performed every minute, the main memory block is 3, and if the page orientation required is 2 1 2 1 2 3 4, and the page frames is 4. If LRU algorithm is adopted, page 1 should be changed (Page 1 has not been used for the longest time) but page 3 should be changed according to LFU algorithm (page 3 is only used once within 10 minutes).It can be seen that the key of LRU is to see the time from the last use of the page to the occurrence of scheduling, the key of LFU is to see the frequency of pages used in a certain period of time. PostVer 0

Please login to reply. Login

1730854984qqcom • 2020-12-09 00:00:31
<a href="http://www.yvsou.com/wp-content/uploads/sites/30/2020/12/discussion10.jpg"><img class="alignnone size-medium wp-image-9098" src="http://www.yvsou.com/wp-content/uploads/sites/30/2020/12/discussion10-226x300.jpg" alt="" width="226" height="300" /></a> PostVer 0

Please login to reply. Login

1720650158qqcom • 2020-12-09 11:50:38
<a href="http://www.yvsou.com/wp-content/uploads/sites/30/2020/12/讨论10.png"><img class="alignnone size-medium wp-image-9101" src="http://www.yvsou.com/wp-content/uploads/sites/30/2020/12/讨论10-300x268.png" alt="" width="300" height="268" /></a> PostVer 0

Please login to reply. Login

653968106qqcom • 2020-12-09 13:04:54
<a href="http://www.yvsou.com/wp-content/uploads/sites/30/2020/12/OD9-1.jpg"><img class="alignnone size-medium wp-image-9109" src="http://www.yvsou.com/wp-content/uploads/sites/30/2020/12/OD9-1-300x297.jpg" alt="" width="300" height="297" /></a> <a href="http://www.yvsou.com/wp-content/uploads/sites/30/2020/12/OD9-2.jpg"><img class="alignnone size-medium wp-image-9110" src="http://www.yvsou.com/wp-content/uploads/sites/30/2020/12/OD9-2-300x286.jpg" alt="" width="300" height="286" /></a> PostVer 0

Please login to reply. Login

454234624qqcom • 2020-12-09 15:33:15
<a href="http://www.yvsou.com/wp-content/uploads/sites/30/2020/12/Online_Disscussion10.jpg"><img class="alignnone size-medium wp-image-9114" src="http://www.yvsou.com/wp-content/uploads/sites/30/2020/12/Online_Disscussion10-300x102.jpg" alt="" width="300" height="102" /></a> PostVer 0

Please login to reply. Login

cfeshete97gmailcom • 2020-12-11 03:16:31
Consider the following sequence of memory accesses in a system that can hold four pages in memory: 1 1 2 3
4 5 1. When page 5 is accessed, the least frequently used page-replacement algorithm would replace a page
other than 1, and therefore would not incur a page fault when page 1 is accessed again. On the other hand,
for the sequence “1 2 3 4 5 2,” the least recently used algorithm performs better. PostVer 0

Please login to reply. Login

1285795916qqcom • 2020-12-12 15:08:42
邱锐鹏 2018329621199

<a href="http://www.yvsou.com/wp-content/uploads/sites/30/2020/12/discussion10_邱锐鹏.png"><img class="alignnone size-medium wp-image-9129" src="http://www.yvsou.com/wp-content/uploads/sites/30/2020/12/discussion10_邱锐鹏-219x300.png" alt="" width="219" height="300" /></a>

&nbsp; PostVer 0

Please login to reply. Login

2470994471qqcom • 2020-12-12 15:54:22
Consider the following sequence of memory accesses in a system thatcan hold four pages in memory: 1 1 2 3 4 5 1. When page 5 is accessed,the least frequently used page-replacement algorithm would replace apage other than 1, and thereforewould not incur a page fault when page1 is accessed again. On the other hand, for the sequence “1 2 3 4 5 2,” theleast recently used algorithm performs better. PostVer 0

Please login to reply. Login

244766935qqcom • 2020-12-14 16:48:26
<a href="http://www.yvsou.com/wp-content/uploads/sites/30/2020/12/1-2.jpg"><img class="alignnone size-medium wp-image-9140" src="http://www.yvsou.com/wp-content/uploads/sites/30/2020/12/1-2-202x300.jpg" alt="" width="202" height="300" /></a> <a href="http://www.yvsou.com/wp-content/uploads/sites/30/2020/12/2-3.jpg"><img class="alignnone size-medium wp-image-9141" src="http://www.yvsou.com/wp-content/uploads/sites/30/2020/12/2-3-300x298.jpg" alt="" width="300" height="298" /></a> PostVer 0

Please login to reply. Login

1210775967qqcom • 2020-12-14 15:57:52
<a href="http://www.yvsou.com/wp-content/uploads/sites/30/2020/12/Online_discussion10.jpg"><img class="alignnone size-medium wp-image-9139" src="http://www.yvsou.com/wp-content/uploads/sites/30/2020/12/Online_discussion10-212x300.jpg" alt="" width="212" height="300" /></a> PostVer 0

Please login to reply. Login

hokyeejaufoxmailcom • 2020-12-15 08:42:24
Given a page string 1 1 2 3 4 5 1. When page 5 is

accessed, the least frequently used page-replacement algorithm would

replace a page other than 1, and therefore would not incur a page fault

when page 1 is accessed again. On the other hand, for the sequence “1 2

3 4 5 2,” the least recently used algorithm performs better. PostVer 0

Please login to reply. Login

1079513613qqcom • 2020-12-15 13:37:57
Consider the following sequence of memory accesses in a system thatcan hold four pages in memory: 1 1 2 3 4 5 1. When page 5 is accessed,the least frequently used page-replacement algorithm would replace apage other than 1, and thereforewould not incur a page fault when page1 is accessed again. On the other hand, for the sequence “1 2 3 4 5 2,” theleast recently used algorithm performs better. PostVer 0

Please login to reply. Login

chipusilesgmailcom • 2020-12-15 15:03:54
<!--more--><!--more--><a href="http://www.yvsou.com/wp-content/uploads/sites/30/2020/12/Av.png"><img class="alignnone size-medium wp-image-9167" src="http://www.yvsou.com/wp-content/uploads/sites/30/2020/12/Av-300x95.png" alt="" width="300" height="95" /></a>Example: <a href="http://www.yvsou.com/wp-content/uploads/sites/30/2020/12/Ex.png"><img class="alignnone size-medium wp-image-9169" src="http://www.yvsou.com/wp-content/uploads/sites/30/2020/12/Ex-300x217.png" alt="" width="300" height="217" /></a> PostVer 0

Please login to reply. Login

1403861656qqcom • 2020-12-20 10:51:33
The LRU algorithm needs to record the order in which each page is used, and there are two possible implementations

The system maintains a linked list of pages, with the most recently used pages as the first node and the most unused pages as the last node. Each time you access memory, find the page, remove it from the list, and move it to the top. Eliminate pages at the end of the list each time a page missing interrupt occurs.

Set an active page "stack". When you visit a page, push the page number to the top of the stack. Then, check whether the stack has the same page number as the page, and pull out if there is one. When weeding out a page, always select the page at the bottom of the stack, which is the most unused page.

Each access requires a general stack to be looked up. This algorithm is expensive. PostVer 0

Please login to reply. Login

shatino94163com • 2020-12-22 14:31:30
Consider the following sequence of memory accesses in a system that can hold four pages in memory: 1 1 2 3 4 5 1. When page 5 is accessed, the least frequently used page-replacement algorithm would replace a page other than 1, and therefore would not incur a page fault when page 1 is accessed again. On the other hand, for the sequence “1 2 3 4 5 2,” the least recently used algorithm performs better. PostVer 0

Please login to reply. Login

450766287qqcom • 2020-12-22 14:36:52
<a href="http://www.yvsou.com/wp-content/uploads/sites/30/2020/12/os10.png"><img src="http://www.yvsou.com/wp-content/uploads/sites/30/2020/12/os10-300x76.png" alt="" width="300" height="76" class="alignnone size-medium wp-image-9198" /></a> PostVer 0

Please login to reply. Login

1224532347qqcom • 2021-01-01 14:33:57
<a href="http://www.yvsou.com/wp-content/uploads/sites/30/2021/01/onilene.jpg"><img class="alignnone size-medium wp-image-9267" src="http://www.yvsou.com/wp-content/uploads/sites/30/2021/01/onilene-300x257.jpg" alt="" width="300" height="257" /></a> PostVer 0

Please login to reply. Login

1079513613qqcom • 2021-01-04 14:21:04
1) LFU is the least frequently used page replacement algorithm, which uses the locality principle to infer the future behavior according to the past page access history of a job in the execution process. It believes that pages that have not been visited in the past may not be visited again in the near future. Therefore, the essence of this algorithm is: when a page needs to be eliminated, the page that has not been used for the longest time in the recent period is always selected to be eliminated. (2) LRU is the least recently used algorithm, which uses the locality principle to infer the future behavior according to the past page access history of a job in the execution process. It believes that pages that have not been visited in the past may not be visited again in the near future. Therefore, the essence of this algorithm is: when a page needs to be eliminated, the page that has not been used for the longest time in the recent period is always selected to be eliminated. Case 1: therefore, when the page error generated by LFU is smaller than that generated by LRU, it can only be realized when the page with short time and the least number of visits has only one page Case 2: when the page error of LRU is less than that of LFU, only when LRU is approximately in ideal condition, that is, "every page swapped out is the latest page to be used among all memory pages". In this way, page swapping can be delayed to the maximum extent. This algorithm is also called ideal page replacement algorithm PostVer 0

Please login to reply. Login

1119833189qqcom • 2021-01-05 00:28:56
Least recently use is the least recently used page replacement algorithm, that is, the longest unused pages are removed first; LRU is the most recently used page replacement algorithm with the lowest frequency, that is, to remove pages that are visited the least in a certain period of time. For example, the second method has a period T of 10 minutes. If the page is paged every minute, the main memory block is 3, or if page direction 2 is needed, it is 12, 12, 34, and the page frame is 4. If you use the LRU algorithm, you need to change page 1 (page 1 takes the longest time), but you need to change page 3 according to the LRU algorithm (page 3 is only used once in 10 minutes). It can be seen that the key to LRU is the time from the last use of the page to the occurrence of scheduling, while the key to LRU is the frequency of page use within a certain period of time.

PostVer 0

Please login to reply. Login

2736689890qqcom • 2021-01-06 21:18:26
2018329621239-严宇豪
Consider the sequence in a system that holds four pages in memory:1 2 3 4 4 4 5 1.The most frequently used page replacement algorithm evicts page4 while fetching page5, while the LRU algorithm evicts page 1. This is unlikely to happen much in practice. For the sequence 1 2 3 4 4 4 5 1 the LRU algorithm makes the right decision. PostVer 0

Please login to reply. Login

439731491qqcom • 2021-01-07 21:52:55
<a href="http://www.yvsou.com/wp-content/uploads/sites/30/2021/01/8FBECB98642DF73E905F3225E0183C95.jpg"><img class="alignnone size-medium wp-image-9327" src="http://www.yvsou.com/wp-content/uploads/sites/30/2021/01/8FBECB98642DF73E905F3225E0183C95-300x225.jpg" alt="" width="300" height="225" /></a> PostVer 0

Please login to reply. Login

962305148qqcom • 2021-01-07 22:18:54
<h2><strong>2018329621064_邢杰焰</strong></h2>
LRU is the least recently used page replacement algorithm, that is to eliminate the longest unused pages first; LFU is the least frequently used page replacement algorithm recently, that is to eliminate the pages with the least number of visits in a certain period of time.For example, the period T of the second method is 10 minutes. If page paging is performed every minute, the main memory block is 3, and if the page orientation required is 2 1 2 1 2 3 4, and the page frames is 4. If LRU algorithm is adopted, page 1 should be changed (Page 1 has not been used for the longest time) but page 3 should be changed according to LFU algorithm (page 3 is only used once within 10 minutes).It can be seen that the key of LRU is to see the time from the last use of the page to the occurrence of scheduling, the key of LFU is to see the frequency of pages used in a certain period of time. PostVer 0

Please login to reply. Login

Reversion History

Loading...
No reversions found.