2. • In computer operating systems, paging is one of the
memory-management schemes by which a computer can
store and retrieve data from secondary storage for use in
main memory.
• In the paging memory-management scheme, the
operating system retrieves data from secondary storage
in same-size blocks called pages.
What is Paging ?
3. PAGE FRAMES
• The main memory is divided into fixed
sized portions called page frame.
• The size of page frame is same as the size
of page because pages have to reside in
page frames.
4.
5. PAGE FAULTS
• A page fault is an error occurred when a
process/user tries to access a page and it is
not present in the physical memory.
During a page fault, the operating system
must:
• Obtain an empty page frame in RAM to use as a
container for the data.
• If, all page frames are in use, the operating system must
select a victim page and replace it with the new page and
to select the victim page we need page replacement
algorithms
7. •First In First Out.
•Least Recently Used
•Optimal Replacement.
•The Clock Algorithm.
• LRU-K
• Low Inter-reference Recency Set (LIRS)
ALGORITHMS
8. First in first out
• First in first out is very easy to implement
• The fifo algorithm select the page for
replacement that has been in memory the longest
time
10. • FIFO is easy to understand.
• It is very easy to implement.
ADVANTAGES
DISADVANTAGES
• Might skip out on important pages
11. LEAST RECENTLY USED (LRU)
• The least recently used page replacement
algorithm keeps track page uses over a short
period of time.
• The least recently used page replacement policy
selects the victim page based on the page which
has not been referenced for the longest time.
13. • LRU page replacement algorithm is quiet efficient.
DISADVANTAGS
• Implementation difficult. This algorithm requires keeping
track of what was used when, which is expensive if one
wants to make sure the algorithm always discards the least
recently used item.
ADVANTAGES
14. • The optimal policy selects that page for
replacement that will not be needed for the
longest time
• The OS keeps track of all pages referenced by
the Program
• This algorithm result is fewest number of
page faults.
OPTIMAL PAGE REPLACEMENT
ALGORITHM
17. CLOCK ALGORITHM
• Variant of FIFO & LRU
• Keep frames in circle
• On page fault, OS:
• Checks reference bit of next frame
• If reference bit = 0, replace page, set bit to 1
• If reference bit = 1, set bit to 0, advance pointer to
next frame
21. LRU-K
• The LRU policy takes into account the recency information
while evicting pages, without considering the frequency.
• LRU-K was proposed which evicts pages with the largest
backward K-distance.
• Backward K-distance of a page p is the distance backward
from the current time to the Kth most recent reference to
the page p
22. LIRS (Low Inter-reference Recency Set)
• The Low Inter-reference Recency Set algorithm takes into
consideration the Inter-Reference Recency of pages as the
dominant factor for eviction
• The Low Inter-reference Recency Set algorithm takes into
consideration the Inter-Reference Recency of pages as the
dominant factor for eviction
• It is assumed that if current IRR of a page is large, then the next
IRR of the block is likely to be large again and hence the page
is suitable for eviction as per Belady's MIN