1 / 11

Page Replacement Algorithms and Simulation

Page Replacement Algorithms and Simulation. Neville Allen. Introduction. Page replacement algorithms decide which page to swap out from memory to allocate a new page to memory. Page fault happens when a page is not in memory and needs to be placed into memory

barbra
Download Presentation

Page Replacement Algorithms and Simulation

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Page Replacement Algorithms and Simulation Neville Allen

  2. Introduction • Page replacement algorithms decide which page to swap out from memory to allocate a new page to memory. • Page fault happens when a page is not in memory and needs to be placed into memory • The idea is to find an algorithm that reduces the number of page faults which limits the time it takes to swap in and swap out a page

  3. First In First OutFIFO • Simple queue structure, the page at the head of the queue gets swapped out when a new page needs to be allocated • The new page gets added to the end of the queue

  4. Least Recently UsedLRU • Min_array that kept track of count value • When page needs to be swapped out look through min_array to find the min value and swap the value from reference array to frame array

  5. Most Recently UsedMRU • Max array keeps track of values of count value • When page needs to be swapped out find the max value in max array and swap the value from reference array to frame array

  6. Second Chance • Bit array that keeps track of one or zero for the particular value from the reference array • When a page needs to be swapped out searches through bit array to find a zero, when it finds a zero it puts the value in reference array to the frame array. If a one is entered it changes the value in bit array to zero and keeps looking for another zero

  7. Optimal • This is in theory the best algorithm to use for page replacement. • This algorithm looks ahead to see the likely hood that a value in the frame array is going to come up soon. If the value in value array doesn’t come up soon it will be swapped out when a new page needs allocated

  8. ResultsFrames = 3 Range = 5

  9. Results Frames = 3 Range = 10

  10. ResultsFrames = 3 Range = 15

  11. Results • I found that MRU and FIFO were some of the best algorithms • Keeping the frame the same when I doubled the range of numbers from 5 to 10 the page faults less then doubled • Increasing the range from 5 to 15, doubles the amount of page faults

More Related