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.pptx
page replacement.pptxpage replacement.pptx
page replacement.pptxhomipeh
 
Thrashing allocation frames.43
Thrashing allocation frames.43Thrashing allocation frames.43
Thrashing allocation frames.43myrajendra
 
Virtual Memory
Virtual MemoryVirtual Memory
Virtual Memoryvampugani
 
Virtual Memory
Virtual MemoryVirtual Memory
Virtual MemoryArchith777
 
Operating system paging and segmentation
Operating system paging and segmentationOperating system paging and segmentation
Operating system paging and segmentationhamza haseeb
 
Computer architecture virtual memory
Computer architecture virtual memoryComputer architecture virtual memory
Computer architecture virtual memoryMazin Alwaaly
 
Memory management ppt
Memory management pptMemory management ppt
Memory management pptManishaJha43
 
Operating System-Memory Management
Operating System-Memory ManagementOperating System-Memory Management
Operating System-Memory ManagementAkmal Cikmat
 
Storage management in operating system
Storage management in operating systemStorage management in operating system
Storage management in operating systemDeepikaT13
 
8 memory management strategies
8 memory management strategies8 memory management strategies
8 memory management strategiesDr. Loganathan R
 
Multiprocessor architecture
Multiprocessor architectureMultiprocessor architecture
Multiprocessor architectureArpan Baishya
 

What's hot (20)

Buffer management
Buffer managementBuffer management
Buffer management
 
page replacement.pptx
page replacement.pptxpage replacement.pptx
page replacement.pptx
 
Virtual memory
Virtual memoryVirtual memory
Virtual memory
 
Virtual memory
Virtual memoryVirtual memory
Virtual memory
 
Thrashing allocation frames.43
Thrashing allocation frames.43Thrashing allocation frames.43
Thrashing allocation frames.43
 
Virtual Memory
Virtual MemoryVirtual Memory
Virtual Memory
 
Ddbms1
Ddbms1Ddbms1
Ddbms1
 
Cache memory
Cache memoryCache memory
Cache memory
 
Virtual Memory
Virtual MemoryVirtual Memory
Virtual Memory
 
Operating system paging and segmentation
Operating system paging and segmentationOperating system paging and segmentation
Operating system paging and segmentation
 
Virtual Memory
Virtual MemoryVirtual Memory
Virtual Memory
 
Computer architecture virtual memory
Computer architecture virtual memoryComputer architecture virtual memory
Computer architecture virtual memory
 
Memory management ppt
Memory management pptMemory management ppt
Memory management ppt
 
Operating System-Memory Management
Operating System-Memory ManagementOperating System-Memory Management
Operating System-Memory Management
 
Virtual memory
Virtual memoryVirtual memory
Virtual memory
 
Opetating System Memory management
Opetating System Memory managementOpetating System Memory management
Opetating System Memory management
 
Cache memory
Cache memory Cache memory
Cache memory
 
Storage management in operating system
Storage management in operating systemStorage management in operating system
Storage management in operating system
 
8 memory management strategies
8 memory management strategies8 memory management strategies
8 memory management strategies
 
Multiprocessor architecture
Multiprocessor architectureMultiprocessor architecture
Multiprocessor architecture
 

Viewers also liked

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 algorithmMuhammad Mansoor Ul Haq
 
Paging and Segmentation in Operating System
Paging and Segmentation in Operating SystemPaging and Segmentation in Operating System
Paging and Segmentation in Operating SystemRaj Mohan
 
Operating Systems and Memory Management
Operating Systems and Memory ManagementOperating Systems and Memory Management
Operating Systems and Memory Managementguest1415ae65
 

Viewers also liked (6)

Pagereplacement algorithm(computional concept)
Pagereplacement algorithm(computional concept)Pagereplacement algorithm(computional concept)
Pagereplacement algorithm(computional concept)
 
Virtual memory and page replacement algorithm
Virtual memory and page replacement algorithmVirtual memory and page replacement algorithm
Virtual memory and page replacement algorithm
 
141060753008 3715302
141060753008 3715302141060753008 3715302
141060753008 3715302
 
Memory management
Memory managementMemory management
Memory management
 
Paging and Segmentation in Operating System
Paging and Segmentation in Operating SystemPaging and Segmentation in Operating System
Paging and Segmentation in Operating System
 
Operating Systems and Memory Management
Operating Systems and Memory ManagementOperating Systems and Memory Management
Operating Systems and Memory Management
 

Similar to Page Replacement Algorithms (20)

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
 
Aries
AriesAries
Aries
 
Shadow paging
Shadow pagingShadow paging
Shadow paging
 
OSCh9
OSCh9OSCh9
OSCh9
 
Ch9 OS
Ch9 OSCh9 OS
Ch9 OS
 
OS_Ch9
OS_Ch9OS_Ch9
OS_Ch9
 
virtual memory
virtual memoryvirtual memory
virtual memory
 
Unix Memory Management - Operating Systems
Unix Memory Management - Operating SystemsUnix Memory Management - Operating Systems
Unix Memory Management - Operating Systems
 
4.-CSE-3201_OL1_Paging.pdf
4.-CSE-3201_OL1_Paging.pdf4.-CSE-3201_OL1_Paging.pdf
4.-CSE-3201_OL1_Paging.pdf
 

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.