際際滷

際際滷Share a Scribd company logo
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 (20)

Page replacement algorithms
Page replacement algorithmsPage replacement algorithms
Page replacement algorithms
sangrampatil81
FUNCTION DEPENDENCY AND TYPES & EXAMPLE
FUNCTION DEPENDENCY  AND TYPES & EXAMPLEFUNCTION DEPENDENCY  AND TYPES & EXAMPLE
FUNCTION DEPENDENCY AND TYPES & EXAMPLE
Vraj Patel
Dbms architecture
Dbms architectureDbms architecture
Dbms architecture
Shubham Dwivedi
Stacks in c++
Stacks in c++Stacks in c++
Stacks in c++
Vineeta Garg
BINARY TREE REPRESENTATION.ppt
BINARY TREE REPRESENTATION.pptBINARY TREE REPRESENTATION.ppt
BINARY TREE REPRESENTATION.ppt
SeethaDinesh
INTRODUCTION TO ARTIFICIAL INTELLIGENCE
INTRODUCTION TO ARTIFICIAL INTELLIGENCEINTRODUCTION TO ARTIFICIAL INTELLIGENCE
INTRODUCTION TO ARTIFICIAL INTELLIGENCE
ravi021
Paging and segmentation
Paging and segmentationPaging and segmentation
Paging and segmentation
Piyush Rochwani
Page replacement algorithms
Page replacement algorithmsPage replacement algorithms
Page replacement algorithms
Piyush Rochwani
Page replacement algorithm
Page replacement algorithmPage replacement algorithm
Page replacement algorithm
Lavina Gehlot
Binomial heap presentation
Binomial heap presentationBinomial heap presentation
Binomial heap presentation
Hafsa.Naseem
Sorting algorithms
Sorting algorithmsSorting algorithms
Sorting algorithms
Trupti Agrawal
Reusibility vs Extensibility in OOAD
Reusibility vs Extensibility in OOADReusibility vs Extensibility in OOAD
Reusibility vs Extensibility in OOAD
Shivani Kapoor
Priority Queue in Data Structure
Priority Queue in Data StructurePriority Queue in Data Structure
Priority Queue in Data Structure
Meghaj Mallick
Timestamp protocols
Timestamp protocolsTimestamp protocols
Timestamp protocols
Prashant Saini
Sparse matrix and its representation data structure
Sparse matrix and its representation data structureSparse matrix and its representation data structure
Sparse matrix and its representation data structure
Vardhil Patel
Operating System - Types Of Operating System Unit-1
Operating System - Types Of Operating System Unit-1Operating System - Types Of Operating System Unit-1
Operating System - Types Of Operating System Unit-1
abhinav baba
B tree
B treeB tree
B tree
Rajendran
Chapter 9 - Virtual Memory
Chapter 9 - Virtual MemoryChapter 9 - Virtual Memory
Chapter 9 - Virtual Memory
Wayne Jones Jnr
Page Replacement
Page ReplacementPage Replacement
Page Replacement
chandinisanz
Queue data structure
Queue data structureQueue data structure
Queue data structure
anooppjoseph
Page replacement algorithms
Page replacement algorithmsPage replacement algorithms
Page replacement algorithms
sangrampatil81
FUNCTION DEPENDENCY AND TYPES & EXAMPLE
FUNCTION DEPENDENCY  AND TYPES & EXAMPLEFUNCTION DEPENDENCY  AND TYPES & EXAMPLE
FUNCTION DEPENDENCY AND TYPES & EXAMPLE
Vraj Patel
BINARY TREE REPRESENTATION.ppt
BINARY TREE REPRESENTATION.pptBINARY TREE REPRESENTATION.ppt
BINARY TREE REPRESENTATION.ppt
SeethaDinesh
INTRODUCTION TO ARTIFICIAL INTELLIGENCE
INTRODUCTION TO ARTIFICIAL INTELLIGENCEINTRODUCTION TO ARTIFICIAL INTELLIGENCE
INTRODUCTION TO ARTIFICIAL INTELLIGENCE
ravi021
Paging and segmentation
Paging and segmentationPaging and segmentation
Paging and segmentation
Piyush Rochwani
Page replacement algorithms
Page replacement algorithmsPage replacement algorithms
Page replacement algorithms
Piyush Rochwani
Page replacement algorithm
Page replacement algorithmPage replacement algorithm
Page replacement algorithm
Lavina Gehlot
Binomial heap presentation
Binomial heap presentationBinomial heap presentation
Binomial heap presentation
Hafsa.Naseem
Reusibility vs Extensibility in OOAD
Reusibility vs Extensibility in OOADReusibility vs Extensibility in OOAD
Reusibility vs Extensibility in OOAD
Shivani Kapoor
Priority Queue in Data Structure
Priority Queue in Data StructurePriority Queue in Data Structure
Priority Queue in Data Structure
Meghaj Mallick
Timestamp protocols
Timestamp protocolsTimestamp protocols
Timestamp protocols
Prashant Saini
Sparse matrix and its representation data structure
Sparse matrix and its representation data structureSparse matrix and its representation data structure
Sparse matrix and its representation data structure
Vardhil Patel
Operating System - Types Of Operating System Unit-1
Operating System - Types Of Operating System Unit-1Operating System - Types Of Operating System Unit-1
Operating System - Types Of Operating System Unit-1
abhinav baba
Chapter 9 - Virtual Memory
Chapter 9 - Virtual MemoryChapter 9 - Virtual Memory
Chapter 9 - Virtual Memory
Wayne Jones Jnr
Page Replacement
Page ReplacementPage Replacement
Page Replacement
chandinisanz
Queue data structure
Queue data structureQueue data structure
Queue data structure
anooppjoseph

Viewers also liked (7)

Pagereplacement algorithm(computional concept)
Pagereplacement algorithm(computional concept)Pagereplacement algorithm(computional concept)
Pagereplacement algorithm(computional concept)
Siddhi Viradiya
Virtual memory and page replacement algorithm
Virtual memory and page replacement algorithmVirtual memory and page replacement algorithm
Virtual memory and page replacement algorithm
Muhammad Mansoor Ul Haq
141060753008 3715302
141060753008 3715302141060753008 3715302
141060753008 3715302
ITM Universe - Vadodara
Memory management
Memory managementMemory management
Memory management
Rajni Sirohi
Paging and Segmentation in Operating System
Paging and Segmentation in Operating SystemPaging and Segmentation in Operating System
Paging and Segmentation in Operating System
Raj Mohan
Operating System-Memory Management
Operating System-Memory ManagementOperating System-Memory Management
Operating System-Memory Management
Akmal Cikmat
Operating Systems and Memory Management
Operating Systems and Memory ManagementOperating Systems and Memory Management
Operating Systems and Memory Management
guest1415ae65
Pagereplacement algorithm(computional concept)
Pagereplacement algorithm(computional concept)Pagereplacement algorithm(computional concept)
Pagereplacement algorithm(computional concept)
Siddhi Viradiya
Virtual memory and page replacement algorithm
Virtual memory and page replacement algorithmVirtual memory and page replacement algorithm
Virtual memory and page replacement algorithm
Muhammad Mansoor Ul Haq
Memory management
Memory managementMemory management
Memory management
Rajni Sirohi
Paging and Segmentation in Operating System
Paging and Segmentation in Operating SystemPaging and Segmentation in Operating System
Paging and Segmentation in Operating System
Raj Mohan
Operating System-Memory Management
Operating System-Memory ManagementOperating System-Memory Management
Operating System-Memory Management
Akmal Cikmat
Operating Systems and Memory Management
Operating Systems and Memory ManagementOperating Systems and Memory Management
Operating Systems and Memory Management
guest1415ae65

Similar to Page Replacement Algorithms (20)

ikh311-06
ikh311-06ikh311-06
ikh311-06
Anung Ariwibowo
LRU_Replacement-Policy.pdf
LRU_Replacement-Policy.pdfLRU_Replacement-Policy.pdf
LRU_Replacement-Policy.pdf
Smt. Indira Gandhi College of Engineering, Navi Mumbai, Mumbai
Hardware implementation of page table
Hardware implementation of page table Hardware implementation of page table
Hardware implementation of page table
Sukhraj Singh
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, ...
International Journal of Engineering Inventions www.ijeijournal.com
Chapter 04
Chapter 04Chapter 04
Chapter 04
Google
Memory Management
Memory ManagementMemory Management
Memory Management
Ramasubbu .P
Case leakage
Case leakageCase leakage
Case leakage
tcbarrett
Topic 1 Data Representation
Topic 1 Data RepresentationTopic 1 Data Representation
Topic 1 Data Representation
Naruin
Hcs Topic 2 Computer Structure V2
Hcs Topic 2  Computer Structure V2Hcs Topic 2  Computer Structure V2
Hcs Topic 2 Computer Structure V2
ekul
Hcs Topic 2 Computer Structure V2
Hcs Topic 2  Computer Structure V2Hcs Topic 2  Computer Structure V2
Hcs Topic 2 Computer Structure V2
Kyle
Hcs Topic 2 Computer Structure V2
Hcs Topic 2  Computer Structure V2Hcs Topic 2  Computer Structure V2
Hcs Topic 2 Computer Structure V2
Naruin
Cache memory
Cache memoryCache memory
Cache memory
Muhammad Imran
Computer architecture page replacement algorithms
Computer architecture page replacement algorithmsComputer architecture page replacement algorithms
Computer architecture page replacement algorithms
Mazin Alwaaly
Virtual memory
Virtual memoryVirtual memory
Virtual memory
tamizh arthanari
Aries
AriesAries
Aries
guest5c197d5
Shadow paging
Shadow pagingShadow paging
Shadow paging
GowriLatha1
Ch9 OS
Ch9 OSCh9 OS
Ch9 OS
C.U
OS_Ch9
OS_Ch9OS_Ch9
OS_Ch9
Supriya Shrivastava
OSCh9
OSCh9OSCh9
OSCh9
Joe Christensen
virtual memory
virtual memoryvirtual memory
virtual memory
Abeer Naskar

More from Kashif Dayo (7)

Thp 14-ict-ii
Thp 14-ict-iiThp 14-ict-ii
Thp 14-ict-ii
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 Systems
Kashif Dayo
Ros Kd
Ros KdRos Kd
Ros Kd
Kashif 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 Schedular
Kashif Dayo
Memory Management In Vmware Esx Server
Memory Management In Vmware Esx ServerMemory Management In Vmware Esx Server
Memory Management In Vmware Esx Server
Kashif 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 Systems
Kashif Dayo
Thp 14-ict-ii
Thp 14-ict-iiThp 14-ict-ii
Thp 14-ict-ii
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 Systems
Kashif 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 Schedular
Kashif Dayo
Memory Management In Vmware Esx Server
Memory Management In Vmware Esx ServerMemory Management In Vmware Esx Server
Memory Management In Vmware Esx Server
Kashif 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 Systems
Kashif Dayo

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

  • #10: 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.