Preview

lru algorithm report

Good Essays
Open Document
Open Document
842 Words
Grammar
Grammar
Plagiarism
Plagiarism
Writing
Writing
Score
Score
lru algorithm report
LRU Page Replacement
The key distinction between the FIFO and OPT algorithms (other than looking backward versus forward in time) is that the FIFO algorithm uses the time when a page was brought into memory, whereas the OPT algorithm uses the time when a page is to be used.
If we use the recent past as an approximation of the near future, then we can replace the page that has not been used for the longest period of time (see Fig. 9.14).

Figure 9.14: LRU page-replacement algorithm.
This approach is the least-recently-used (LRU) algorithm. The result of applying LRU replacement to our example reference string is shown in Fig. 9.14. The LRU algorithm produces 12 faults.
Notice that the first 5 faults are the same as those for optimal replacement.
When the reference to page 4 occurs, however, LRU replacement sees that, of the three frames in memory, page 2 was used least recently.
Thus, the LRU algorithm replaces page 2, not knowing that page 2 is about to be used.
When it then faults for page 2, the LRU algorithm replaces page 3, since it is now the least recently used of the three pages in memory.
Despite these problems, LRU replacement with 12 faults is much better than FIFO replacement with 15.
Allocation of Frames
Now, first major problem mentioned in Section 9.4.1 will be discussed. How do we allocate the fixed amount of free memory among the various processes?
If we have 93 free frames and two processes, how many frames does each process get?
The simplest case is the single-user system.
Consider a single-user system with 128 KB of memory composed of pages 1 KB in size. This system has 128 frames.
The OS may take 35 K8, leaving 93 frames for the user process.
Under pure demand paging, all 93 frames would initially be put on the free-frame list.
When a user process started execution, it would generate a sequence of page faults.
The first 93 page faults would all get free frames from the free-frame list.
When the free-frame list was

You May Also Find These Documents Helpful

  • Good Essays

    Nt1330 Unit 4 Case Study

    • 359 Words
    • 2 Pages

    that is to keep the slowdown due to paging to a reasonable level, we can allow only less than one memory access out 2,500,000 to page fault. in a demand paging system keep the page…

    • 359 Words
    • 2 Pages
    Good Essays
  • Good Essays

    Some OS routines directly support application programs as they run and thus must be resident. Other transient routines are stored on disk and read into memory only when needed. Fixed-length partitions can also be used to allocate the set amount of memory that a particular program needs to run. Under dynamic memory management, the transient area is treated as a pool of unstructured free space. When the system decides to load a particular program, a region of memory just sufficient to hold the program is allocated from the pool. Using segmentation, programs are divided into independently addressed segments and stored in noncontiguous memory. Paging breaks a program into fixed-length pages.…

    • 7085 Words
    • 29 Pages
    Good Essays
  • Satisfactory Essays

    The second category of fault changes individual instructions in the text segment. These faults are intended to approximate the assembly-level manifestation of real C-level programming…

    • 285 Words
    • 2 Pages
    Satisfactory Essays
  • Good Essays

    Nt1210 Chapter 1 Review

    • 1315 Words
    • 6 Pages

    5. This chapter describes the concepts behind how a CPU reads the contents from RAM. Which of the following is true about the process of read data. As described in the chapter?…

    • 1315 Words
    • 6 Pages
    Good Essays
  • Satisfactory Essays

    Lab assign

    • 276 Words
    • 2 Pages

    - It took 0.000408000 secs and te Tie delta frame was 0.00408000 secs and the Time since the first fram is 0.027553000 secs…

    • 276 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    CHAPTER3 REVEIW

    • 527 Words
    • 3 Pages

    5. This chapter describes the concepts behind how a CPU reads the contents from RAM. Which of the following is true about the process of read data, as described in the chapter?…

    • 527 Words
    • 3 Pages
    Satisfactory Essays
  • Good Essays

    Exam 11A

    • 1635 Words
    • 16 Pages

    Page files are used when the CPU runs out of physical memory. The disadvantage of this is that ________…

    • 1635 Words
    • 16 Pages
    Good Essays
  • Good Essays

    This chapter describes the concepts behind how a CPU reads the contents from RAM. Which of the following is true about the process of read data, as described in the chapter?…

    • 605 Words
    • 3 Pages
    Good Essays
  • Good Essays

    Apa Check List

    • 653 Words
    • 3 Pages

    Note: Do not confuse the page header with the running head. The running head is typically used ONLY for material submitted for publication (p. 296, 5.15).…

    • 653 Words
    • 3 Pages
    Good Essays
  • Satisfactory Essays

    Cache memory is on the main chip, it can be accessed much more quickly than RAM, which is restricted by the BUS speed. Data is held in the Processor cache memory, where it is close to the processor, thus speeding up the operation of the processor. The implementations of cache memory on multi-core chips do vary from one manufacturer to another but have to adhere to a certain code.…

    • 922 Words
    • 4 Pages
    Satisfactory Essays
  • Powerful Essays

    Tv Final

    • 2701 Words
    • 11 Pages

    In normal television there are 30 frames per second of video. It is written in the format of hours:minutes:seconds:frames…

    • 2701 Words
    • 11 Pages
    Powerful Essays
  • Good Essays

    rapidly, it may not be indicated by the script that it has changed, and was most…

    • 1033 Words
    • 5 Pages
    Good Essays
  • Powerful Essays

    Animation is a complicated process involving twenty-four drawings for each second of screen time needed. This…

    • 1134 Words
    • 4 Pages
    Powerful Essays
  • Satisfactory Essays

    Finco Man

    • 1455 Words
    • 6 Pages

    Under the FIFO method, all spoilage costs are assumed to be related to the units completed during this period using the unit costs of the current period.…

    • 1455 Words
    • 6 Pages
    Satisfactory Essays
  • Good Essays

    H. 264/Avr Analysis

    • 826 Words
    • 4 Pages

    Instead, it can select the reference frame prior to the corrupted picture whenever feedback information is received. One form of reference picture selection can be demonstrated in Fig. 4.11, it shows the transmission of frames 1 through 9. The encoder prediction is indicated by the use of curved arrows in the figure. In this concept, the most recent frame is usually utilized as the reference frame for motion-compensation prediction. However, if frame 4 gets corrupted by packet loss, the decoder immediately signals a negative acknowledgement (NACK) message to the encoder about the error. This informs the encoder that frame number 4 is damaged, and that all subsequent frames are prone to error propagation. In this regard, the encoder then selects the most recent frame known to be correctly received (frame 3 in this figure) as a reference for the encoding of the next frame, which is frame 6. Round Trip Time (RTT) determines the required amount of time for the prediction structure to be altered, and consequently determines the number of frames that will be affected by the error propagation…

    • 826 Words
    • 4 Pages
    Good Essays