SlideShare a Scribd company logo
1 of 9
Page replacement algorithms
        Ubaidullah alias kashif
             MSCCN-III
             Sukkur IBA.
Paging:- 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.
Page fault The main functions of paging are
performed when a program tries to access
pages that are not currently mapped to physical
memory (RAM). This situation is known as a
page fault.
Page replacement algorithm
Page replacement algorithms decide which
memory pages to page out (swap out, write
to disk) when a page of memory needs to be
allocated.
 Paging happens when a page fault occurs and
a free page cannot be used to satisfy the
allocation, either because there are none, or
because the number of free pages is lower
than some threshold.
Clock



The clock algorithm keeps a circular list of pages in
memory, with the "hand" (iterator) pointing to the last
examined page frame in the list.
When a page fault occurs and no empty frames exist, then the R
(referenced) bit is inspected at the hand's location. If R is 0, the
new page is put in place of the page the "hand" points
to, otherwise the R bit is cleared. Then, the clock hand is
incremented and this process is repeated until a page is found
with R = 0
LRU & NRU


LRU keeps track of page usage over a short period of
time, while NRU just looks at the usage in the last
clock interval.
Adaptive replacement cache

ARC improves the basic LRU strategy by splitting the
cache directory into two lists, T1 and T2, for recently
and frequently referenced entries.
In turn, each of these is extended with a ghost list (B1
or B2), which is attached to the bottom of the two
lists. These ghost lists act as scorecards by keeping
track of the history of recently evicted (expelled)
cache entries, and the algorithm uses ghost hits to
adapt to recent change in resource usage.
T1, for recent cache entries.
T2, for frequent entries, referenced at least twice.
B1, ghost entries recently evicted from the T1 cache, but are still
tracked.
B2, similar ghost entries, but evicted from T2.
T1 and B1 together are referred to as L1, a combined history of
recent single references. Similarly, L2 is the combination of T2
and B2
...[    B1     <-[         T1          <-!-> T2    ]->  B2 ] . ….
   [ ……………. . . . [ . . . . . . ! . .^. …………...... ] …… . . . ]
                  [       fixed cache size (c)      ]

More Related Content

What's hot

Page replacement
Page replacementPage replacement
Page replacementsashi799
 
Operating system memory management
Operating system memory managementOperating system memory management
Operating system memory managementrprajat007
 
Operating system paging and segmentation
Operating system paging and segmentationOperating system paging and segmentation
Operating system paging and segmentationhamza haseeb
 
Operating System-Memory Management
Operating System-Memory ManagementOperating System-Memory Management
Operating System-Memory ManagementAkmal Cikmat
 
Virtual memory
Virtual memoryVirtual memory
Virtual memoryAnuj Modi
 
Operating systems system structures
Operating systems   system structuresOperating systems   system structures
Operating systems system structuresMukesh Chinta
 
Chapter 9 - Virtual Memory
Chapter 9 - Virtual MemoryChapter 9 - Virtual Memory
Chapter 9 - Virtual MemoryWayne Jones Jnr
 
Concurrency Control in Distributed Database.
Concurrency Control in Distributed Database.Concurrency Control in Distributed Database.
Concurrency Control in Distributed Database.Meghaj Mallick
 
Chapter 10 - File System Interface
Chapter 10 - File System InterfaceChapter 10 - File System Interface
Chapter 10 - File System InterfaceWayne Jones Jnr
 
Page replacement algorithms
Page replacement algorithmsPage replacement algorithms
Page replacement algorithmssangrampatil81
 
Disk scheduling algorithms
Disk scheduling algorithms Disk scheduling algorithms
Disk scheduling algorithms Paresh Parmar
 

What's hot (20)

Page replacement
Page replacementPage replacement
Page replacement
 
Operating system memory management
Operating system memory managementOperating system memory management
Operating system memory management
 
Swapping | Computer Science
Swapping | Computer ScienceSwapping | Computer Science
Swapping | Computer Science
 
Operating system paging and segmentation
Operating system paging and segmentationOperating system paging and segmentation
Operating system paging and segmentation
 
Memory management
Memory managementMemory management
Memory management
 
Distributed DBMS - Unit 5 - Semantic Data Control
Distributed DBMS - Unit 5 - Semantic Data ControlDistributed DBMS - Unit 5 - Semantic Data Control
Distributed DBMS - Unit 5 - Semantic Data Control
 
Demand paging
Demand pagingDemand paging
Demand paging
 
Operating System-Memory Management
Operating System-Memory ManagementOperating System-Memory Management
Operating System-Memory Management
 
Memory Management
Memory ManagementMemory Management
Memory Management
 
Fragmentaton
Fragmentaton Fragmentaton
Fragmentaton
 
Virtual memory
Virtual memoryVirtual memory
Virtual memory
 
Operating systems system structures
Operating systems   system structuresOperating systems   system structures
Operating systems system structures
 
Chapter 9 - Virtual Memory
Chapter 9 - Virtual MemoryChapter 9 - Virtual Memory
Chapter 9 - Virtual Memory
 
Concurrency Control in Distributed Database.
Concurrency Control in Distributed Database.Concurrency Control in Distributed Database.
Concurrency Control in Distributed Database.
 
Memory management
Memory managementMemory management
Memory management
 
Chapter 10 - File System Interface
Chapter 10 - File System InterfaceChapter 10 - File System Interface
Chapter 10 - File System Interface
 
Semi join
Semi joinSemi join
Semi join
 
Memory management
Memory managementMemory management
Memory management
 
Page replacement algorithms
Page replacement algorithmsPage replacement algorithms
Page replacement algorithms
 
Disk scheduling algorithms
Disk scheduling algorithms Disk scheduling algorithms
Disk scheduling algorithms
 

Similar to Page Replacement Algorithms

Similar to Page Replacement Algorithms (20)

141060753008 3715302
141060753008 3715302141060753008 3715302
141060753008 3715302
 
ikh311-06
ikh311-06ikh311-06
ikh311-06
 
LRU_Replacement-Policy.pdf
LRU_Replacement-Policy.pdfLRU_Replacement-Policy.pdf
LRU_Replacement-Policy.pdf
 
Hardware implementation of page table
Hardware implementation of page table Hardware implementation of page table
Hardware implementation of page table
 
call for papers, research paper publishing, where to publish research paper, ...
call for papers, research paper publishing, where to publish research paper, ...call for papers, research paper publishing, where to publish research paper, ...
call for papers, research paper publishing, where to publish research paper, ...
 
Chapter 04
Chapter 04Chapter 04
Chapter 04
 
Memory Management
Memory ManagementMemory Management
Memory Management
 
Case leakage
Case leakageCase leakage
Case leakage
 
Topic 1 Data Representation
Topic 1 Data RepresentationTopic 1 Data Representation
Topic 1 Data Representation
 
Hcs Topic 2 Computer Structure V2
Hcs Topic 2  Computer Structure V2Hcs Topic 2  Computer Structure V2
Hcs Topic 2 Computer Structure V2
 
Hcs Topic 2 Computer Structure V2
Hcs Topic 2  Computer Structure V2Hcs Topic 2  Computer Structure V2
Hcs Topic 2 Computer Structure V2
 
Hcs Topic 2 Computer Structure V2
Hcs Topic 2  Computer Structure V2Hcs Topic 2  Computer Structure V2
Hcs Topic 2 Computer Structure V2
 
Cache memory
Cache memoryCache memory
Cache memory
 
Computer architecture page replacement algorithms
Computer architecture page replacement algorithmsComputer architecture page replacement algorithms
Computer architecture page replacement algorithms
 
Virtual memory
Virtual memoryVirtual memory
Virtual memory
 
Aries
AriesAries
Aries
 
Shadow paging
Shadow pagingShadow paging
Shadow paging
 
OS_Ch9
OS_Ch9OS_Ch9
OS_Ch9
 
OSCh9
OSCh9OSCh9
OSCh9
 
Ch9 OS
Ch9 OSCh9 OS
Ch9 OS
 

More from Kashif Dayo

Selecting cryptographic technique in peer to peer to Systems
Selecting cryptographic technique in peer to peer to SystemsSelecting cryptographic technique in peer to peer to Systems
Selecting cryptographic technique in peer to peer to SystemsKashif Dayo
 
Allevating the Thrashing by Adding Medium-Term Schedular
Allevating the Thrashing by Adding Medium-Term SchedularAllevating the Thrashing by Adding Medium-Term Schedular
Allevating the Thrashing by Adding Medium-Term SchedularKashif Dayo
 
Memory Management In Vmware Esx Server
Memory Management In Vmware Esx ServerMemory Management In Vmware Esx Server
Memory Management In Vmware Esx ServerKashif Dayo
 
Exokernel Operating System (1)
Exokernel Operating System (1)Exokernel Operating System (1)
Exokernel Operating System (1)Kashif Dayo
 
Dynamic Analysis And Profiling Of Multi Threaded Systems
Dynamic Analysis And Profiling Of Multi Threaded SystemsDynamic Analysis And Profiling Of Multi Threaded Systems
Dynamic Analysis And Profiling Of Multi Threaded SystemsKashif Dayo
 

More from Kashif Dayo (7)

Thp 14-ict-ii
Thp 14-ict-iiThp 14-ict-ii
Thp 14-ict-ii
 
Selecting cryptographic technique in peer to peer to Systems
Selecting cryptographic technique in peer to peer to SystemsSelecting cryptographic technique in peer to peer to Systems
Selecting cryptographic technique in peer to peer to Systems
 
Ros Kd
Ros KdRos Kd
Ros Kd
 
Allevating the Thrashing by Adding Medium-Term Schedular
Allevating the Thrashing by Adding Medium-Term SchedularAllevating the Thrashing by Adding Medium-Term Schedular
Allevating the Thrashing by Adding Medium-Term Schedular
 
Memory Management In Vmware Esx Server
Memory Management In Vmware Esx ServerMemory Management In Vmware Esx Server
Memory Management In Vmware Esx Server
 
Exokernel Operating System (1)
Exokernel Operating System (1)Exokernel Operating System (1)
Exokernel Operating System (1)
 
Dynamic Analysis And Profiling Of Multi Threaded Systems
Dynamic Analysis And Profiling Of Multi Threaded SystemsDynamic Analysis And Profiling Of Multi Threaded Systems
Dynamic Analysis And Profiling Of Multi Threaded Systems
 

Page Replacement Algorithms

  • 1. Page replacement algorithms Ubaidullah alias kashif MSCCN-III Sukkur IBA.
  • 2. Paging:- 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. Page fault The main functions of paging are performed when a program tries to access pages that are not currently mapped to physical memory (RAM). This situation is known as a page fault.
  • 3. Page replacement algorithm Page replacement algorithms decide which memory pages to page out (swap out, write to disk) when a page of memory needs to be allocated. Paging happens when a page fault occurs and a free page cannot be used to satisfy the allocation, either because there are none, or because the number of free pages is lower than some threshold.
  • 4. Clock The clock algorithm keeps a circular list of pages in memory, with the "hand" (iterator) pointing to the last examined page frame in the list.
  • 5. When a page fault occurs and no empty frames exist, then the R (referenced) bit is inspected at the hand's location. If R is 0, the new page is put in place of the page the "hand" points to, otherwise the R bit is cleared. Then, the clock hand is incremented and this process is repeated until a page is found with R = 0
  • 6. LRU & NRU LRU keeps track of page usage over a short period of time, while NRU just looks at the usage in the last clock interval.
  • 7. Adaptive replacement cache ARC improves the basic LRU strategy by splitting the cache directory into two lists, T1 and T2, for recently and frequently referenced entries. In turn, each of these is extended with a ghost list (B1 or B2), which is attached to the bottom of the two lists. These ghost lists act as scorecards by keeping track of the history of recently evicted (expelled) cache entries, and the algorithm uses ghost hits to adapt to recent change in resource usage.
  • 8. T1, for recent cache entries. T2, for frequent entries, referenced at least twice. B1, ghost entries recently evicted from the T1 cache, but are still tracked. B2, similar ghost entries, but evicted from T2. T1 and B1 together are referred to as L1, a combined history of recent single references. Similarly, L2 is the combination of T2 and B2
  • 9. ...[ B1 <-[ T1 <-!-> T2 ]-> B2 ] . …. [ ……………. . . . [ . . . . . . ! . .^. …………...... ] …… . . . ] [ fixed cache size (c) ]

Editor's Notes

  1. New entries enter T1, to the left of !, and are gradually pushed to the left, eventually being evicted from T1 into B1, and finally dropped out altogether.Any entry in L1 that gets referenced once more, gets another chance, and enters L2, just to the right of the central ! marker. From there, it is again pushed outward, from T2 into B2. Entries in L2 that get another hit can repeat this indefinitely, until they finally drop out on the far right of B2.