Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Page Replacement Algorithms - Challenges and Trends: September 2017

Download as pdf or txt
Download as pdf or txt
You are on page 1of 6

See discussions, stats, and author profiles for this publication at: https://www.researchgate.

net/publication/319997969

Page Replacement Algorithms – Challenges and Trends

Article · September 2017

CITATIONS READS

3 5,011

2 authors:

Rajesh Ramachandran Hitha Paulson


CHRIST(Deemed to be University) Little Flower College , Guruvayoor
36 PUBLICATIONS   52 CITATIONS    5 PUBLICATIONS   3 CITATIONS   

SEE PROFILE SEE PROFILE

Some of the authors of this publication are also working on these related projects:

Memory Management View project

Utilization of Natural Resources View project

All content following this page was uploaded by Rajesh Ramachandran on 23 September 2017.

The user has requested enhancement of the downloaded file.


International Journal of Computer & Mathematical Sciences
IJCMS
ISSN 2347 – 8527
Volume 6, Issue 9
September 2017

Page Replacement Algorithms – Challenges and Trends

Hitha Paulson Dr. Rajesh R


Research Scholar, Bharathiar University, Professor, Dept. of Computer Applications ,Sree
Coimbatore Narayana Gurukulam College of Engineering,
Assistant Professor, Dept of Computer Science, Kadayiruppu P.O, Kolenchery, Ernakulam dist.,
Little Flower College, Guruvayoor, Kerala ,India. Kerala, India

Abstract trace as input. Record of the trace of pages accessed


In a virtual memory environment the basic principle by the process previously is known to be the page
of program execution is the adaptiveness of an Operating trace. The algorithms relay either on local
System environment to larger programs with in the replacement – replace a page of the faulting process
limitation of the addressable small primary memory. or global replacement – replace the page of another
Page Replacement algorithms play an important role in process. The number of frames allocated to a
implementing this memory setting with an aim to program and the replacement algorithm used
accomplish less page fault, high hit ratio and minimum determines the speed of demand paging. Major
overhead. Over the years many page replacement research is going on in the area of page replacement
algorithms were designed and proposed. As the memory
techniques and this paper also accounts on the key
types and program designing approaches improved, the
need for betterment in algorithms existed as a need. This
research outcomes in the area.
paper summarizes the techniques and challenges behind
the major traditional page replacement algorithms and II. PERFORMANCE PARAMETERS
accounts on the various research outcomes in this area.
The efficiency of page replacement algorithms
Keywords: LRU , CLOCK, FLASH, CACHE, Page
depends on the following parameters.
replacement, Algorithm
Page fault rate – p, indicates the rate by which page
miss occurs for a set of page references. The value
I. INTRODUCTION of p lies between 0 and 1. Less the page fault rate,
The idea of virtual memory paved way to the high the efficiency of the algorithm.
execution of programs larger than main memory. Hit rate -ht , indicates the rate by which page hit
Advancement in technology led to execution of occurs for a set of page references. The value of ht
more than a program at a time, and these lies between 0 and 1. High the hit rate, high the
multiprogramming systems demanded more from efficiency of the algorithm.
the memory management techniques of virtual
Effective Access Time- EAT, indicates access time
memory environment. The method of segmentation
needed for a page reference considering the various
and paging supported these techniques. Through
factors of page acces.
paging the real/physical address space of a process
can be noncontiguous. Since pages are small in size EAT = (1 – p) x memory access + p (page fault
compared to segments the problem of fitting in to overhead + swap page out+ swap page in + restart
memory blocks reduced considerably [1]. overhead) [5]
Rather than loading the pages before access
request, they are brought into memory only when III. CHALLENGES
the executing process asks for them. This process is The ever existed challenge of page replacement
known as demand paging. A page fault occurs when algorithm is to find the right victim to swap out
a demanded page is not in the main memory and has during a page miss with fully occupied frames.. All
to bring them from secondary memory. If the major versions of Windows use the clock algorithm
memory is full in this situation an existing page (LRU) for uni-processor systems and a random-page
needs to be abandoned. Page replacement algorithms replacement algorithm on multi-processor
helps in identifying the victim by overlooking at the systems. Linux uses LRU. Clock algorithm is the
future references expected [2]. The placement and efficient LRU algorithm reported still.
replacement strategies of the algorithm take the page

112
112 Hitha Paulson, Dr. Rajesh R
International Journal of Computer & Mathematical Sciences
IJCMS
ISSN 2347 – 8527
Volume 6, Issue 9
September 2017

The second major problem faced is to find the no First in First Out (FIFO) page replacement algorithm
of frames to be allocated in the main memory to a often suffers from this.
process. It is the number of frames relocated which
influences the page fault rate to a certain extend.
The least number of frames allocated to a process
depends on system architecture and on the number
of pages that could be referenced by a single
instruction. Certain instructions refer multiple pages
even for its fetch[12]. Certain allocation policies
followed are *Equal Allocation – where all n
processes get m/n frames when m is the total
number of frames. The remaining frames are kept in
free pool. *Proportional Allocation - Distribute the
frames proportionally according to the size of the
process. So if the size of process i is S_i, and S is the Fig :
sum of all S_i, then the allocation for process P_i is 2 Belady's Anomaly in FIFO algorithm [3]
a_i = m * S_i / S [3]. Now a days various memory types with varying life
When the memory frames allotted filled up time and speed of access are used. They demands
completely, in certain cases processes goes on much less page fault rate with less read and write to
of its time for paging rather than utilising CPU. This memory. These are the base challenges faced by
problem is termed as Thrashing. Adding up of more algorithm designers in page replacement
processes (increasing multiprogramming level ) is
also another cause for thrashing. Fig: 1 illustrates IV. BASE TECHNIQUES
Thrashing
First in First out: Here usually a linked list is used
for page management. The list is created according
to the time of arrival of pages to main memory.
When a page fault occurs delete one at the head and
attach the newly added page to the tail of the list. In
certain implementations rather than using a linked
list , a time stamp field is used to identify the order
of page arrival. Another implementation is : when a
fault occurs the page pointed by the pointer is
replaced and at the same place the new page is
swapped in. After this, the pointer moves to the next
page [4]. An average of 50 percent hit ratio is
reported by FIFO algorithms.
Least Recently Used (LRU): Usually the page
references from a process follow the fact that they
cluster in a same area. This algorithm believes in
Fig: 1 Thrashing [3] this principle and selects the victim page as that
To prevent thrashing grant processes with which is not been demanded for access for a long
adequate frames as they really need presently and time. The implementation of this technique is a bit
also should control the level of multiprogramming in difficult since a proper history recording is needed
a system. Working Set Algorithm proposed reduced for the technique. Tagging of each page reference
thrashing to certain extend. To lessen thrashing, with its time is one technique of implementation[5].
paging algorithms experimented with allocating An average of 60 percent hit ratio is reported by
more number of frames to a process. But in certain LRU algorithms.
algorithms increasing the number of page frames Optimal Algorithm: This algorithm, selects victim
results in an increase in the number of page faults whose reference is furthest.This algorithm is known
for a given memory reference pattern and the to be a non implemental one, since it requires to
phenomenon is known as Belady's Anomaly[1]. the know the future. But it has the best page fault
behaviour reported[4]. Certain threaded

113
113 Hitha Paulson, Dr. Rajesh R
International Journal of Computer & Mathematical Sciences
IJCMS
ISSN 2347 – 8527
Volume 6, Issue 9
September 2017

programming environments uses algorithms with Replacement techniques in Primary Memory


properties of optimal replacement, since they can and Cache
predict the further memory reference to certain Pooja Khulbe and Shruti Pant suggested an
extend. This optimal result is referred to as Belady’s algorithm Hybrid (LRU) Page-Replacement
MIN algorithm or the clairvoyant algorithm. Algorithm uses an extra feature that is total number
The Not Frequently Used (NFU) Algorithm: of references(TNR) for each page which will be
In this algorithm a counter is related to each page.. counted on each referred page. it uses the idea of
On every timer interrupt, the Operating system modified reference, when a page is modified, a
checks each page and If the Reference Bit is set, modified reference is set i.e. M=1 for that page[12].
page counter is incremented and clear the bit. The When a page fault occurs the page with minimum
counter specifies often the page is referred. For TNR will be chosen as the victim. If many pages
replacement, the page with minimum counter value share the minimum TNR, basic LRU is applied.
is selected. The disadvantage with this technique is HLRU reported better hit ratio than normal LRU.
if the page is greatly used its counter value will be so Yifeng Zhu, Hong Jiang et.al.[6] proposed a Robust
high and that page cannot be replaced for a long Adaptive buffer Cache management scheme
time even if it is not referenced again. (RACE). In this scheme block access is initiated in a
The Second Chance Page Replacement cache. To track the referencing pattern it uses hash
Algorithm: Modification to FIFO. Pages are kept in table technique. The hash tables uses parameters like
a linked list so that the oldest page will be in the inode, start and end block number, the last access
front. If its “referenced bit” is 0, the page is made as made to the first block, looping period, last access to
victim, Else Clear its “referenced bit” and Move it to the referenced block, last accessed block, fresh
the end of the list . Repeat steps. counter, reuse counter. After reference detection
block is allotted in the cache allocation or
The Clock Page Replacement Algorithm:
replacement is done with a known replacement
In this algorithm all page frames are arranged in a policy fit for the identified pattern.
circular queue and a pointer is used to point to the
Reetu Gupta et.al. [7], Proposed Block Pattern
oldest page in the circular queue. The reference bit
Based Buffer Cache Management technique. It
related to each page get set when the page is
works in program context level and file level. This
referenced. The replacement victim page is selected
method tracks the program activities and predicts
in such a way that if it is set in the page , that bit is
the access pattern. Hash table method is used here.
reset to zero and its points to next older page. This
Hit ratio increased to a large extend with this
step continuous until a page with reference bit zero
prediction technique.Namrata Dafre and Deepak
is found. The victim is removed and a new page is
Kapgate [8] suggested a novel cache replacement
placed in the same position with reference bit equals
policy. This method also predicts the future
zero. This algorithm abstracts LRU very
references and uses the concept of inter-reference
proficiently with less overhead [2].
recency for prediction and uses response time
Working set page replacement: This algorithm recorded to find the replacement victim.
follows pre paging property. The group of pages a
K. Ravindra Babu and G. Pavan Kumar [13]
process needs is called the working set. If working
proposed Enhanced Hybrid LRU Page Replacement
set is in memory, no page faults. Rather than loading
Algorithm which is the combination of Hybrid LRU
pages on demand, pages are pre paged so that the
and Enhanced second chance algorithm. This
working set exists. The technique is efficient but
algorithm uses an extra feature STR (spent time
difficult and costlier to implement.
since last reference) for each page that holds the
time when that page was referenced. Two
V. NEW TRENDS parameters TNR (Total no. of references) and STR
New page replacement algorithm designs are used for evaluation. Page with minimum
where developed in view of tremendous changes number of references and maximum spent time
reported in the area of processors and operating since last reference are selected as victim.
system. This section summarises major research The concept of Inverted Page Table also contributed
outcomes in the area of replacement algorithms and to new trends in algorithm design. Inverted page
focuses on the new replacement algorithms table is a global page table rather than a process
developed for flash memories. wise table. Since multiple entry of page information

114
114 Hitha Paulson, Dr. Rajesh R
International Journal of Computer & Mathematical Sciences
IJCMS
ISSN 2347 – 8527
Volume 6, Issue 9
September 2017

in process wise page table is eliminated here a VI CONCLUSION


memory optimization to a large extend is achieved Studying various page replacement algorithms
here. The virtual address to the physical address pointed out that the LRU algorithm has had the
transformation time is also reduced [14]. better results than many other algorithms but has
Replacement in Flash System room for improvement. Optimal algorithm which is
The write operations in flash memory are complex the superior one theoretically needs to be addressed
and costlier than hard disk operations. Also erase more seriously for a better implementation. The
operations are more costlier than write operations. earlier focus of the page replacement algorithms was
The life period of flash systems are shorter than on the selection of victim and to lessen the page
hard disk, so careful and wise transfer of pages are fault, but as the memory types with varying speed
needed in flash systems. With in these limitations, demanded less page write and page read the existing
the low power consumption of memories and speed algorithms need to be addressed in a different view
in accessing the data made this memory popular. angle.
Table 1 shows the major differences in hard disk
and flash memory parameters. VII REFERENCES
Memory Hard disk Flash [1] A. Silberschatz and P. B. Galvin, Operating System
Type Drive Concepts.
Read/ Write Largely Heavily [2] Amit S. Chavan, Kartik R. Nayak, Keval D. Vora,
Performance Symmetric Asymmetric Manish D. Purohit and Pramila M. Chawan, “A
Comparison of Page Replacement Algorithms”,
Background Rare Regular IACSIT International Journal of Engineering and
ops Technology, Vol.3, No.2, pp. 171-174,April 2011
Wear Out Largely Limited [3]Abraham Silberschatz, Greg Gagne, and Peter Baer
Unlimited Write Galvin, "Operating System Concepts, Ninth Edition
Latency 10s milli 10s – 100s "
sec micro sec [4] Anvita Saxena, “A Study of Page Replacement
Algorithms”, International Journal of Engineering
Addressing Sequence Direct, byte
Research and General Science Volume 2, Issue 4,
sector addressable
June-July, 2014
Table 1: Hard disk VS Flash [5] Amit S. Chavan, Kartik R. Nayak, Keval D. Vora,
S.Y. Park and D. Jung in [9] proposed the Clean Manish D. Purohit and Pramila M. Chawan, A
First LRU (CFLRU) replacement policy which Comparison of Page Replacement Algorithms,
IACSIT, vol.3, no.2, April 2011.
considers the balancing issues in the cost of read and
[6] Yifeng Zhu, Hong Jiang ,“RACE: A Robust Adaptive
write operations of the flash memory when Caching Strategy for Buffer Cache”, IEEE
performing page replacement. Here certain amounts Transaction on computers, 2007.
of dirty pages are kept intentionally in page cache to [7] Urmila Shrawankar, Reetu Gupta, “Block Pattern
lessen the number of flash write operations. This is Based Buffer Cache Management”, The 8th
the first replacement algorithm proposed for flash International Conference on Computer Science &
memory. H. Jung et al. proposed LRU-WSR with Education, April 26-28, Colombo, 2013.
the objective of minimizing the number of [8] Namrata Dafre, Deepak Kapgate, “ Novel Cache
replacements of dirty pages during page replacement Replacement Algorithm”, International Journal Of
[10]. The strategy used to achieve this objective is Engineering And Computer Science ISSN: 2319-
7242 Volume 3 Issue 6 June, 2014 Page No. 6260-
delaying the replacement of pages which is dirty and 6266
has higher reference frequency as possible [10]. [9] Y. Park and D. Jung, “CFLRU: A replacement
Xian Tang and Xiaofeng Meng introduced an algorithm for flash memory,” Proc. of the 2006
adaptive cost-aware replacement policy (ACR) International Conference on compilers, Architecture
which is using three cost-based criterions in order to and Synthesis for embedded systems, pp. 234-241,
select the victim page [11]. The algorithm works 2006.
really well for different types of flash disks. They [10] H. Jung, H. Shim, S. Park, S. Kang and J. Cha,
“LRU-WSR: Integration of LRU and writes
divided the buffer pages into two lists: clean and
sequence reordering for flash memory,” IEEE
dirty lists and follow LRU replacement method. The Transactions on Consumer Electronics, Vol. 54, No.
page out victim is selected from clean list usually so 3, pp. 1215-1223, 2008.
that page writes can be avoided.

115
115 Hitha Paulson, Dr. Rajesh R
International Journal of Computer & Mathematical Sciences
IJCMS
ISSN 2347 – 8527
Volume 6, Issue 9
September 2017

[11] Xian Tang, Xiaofeng Meng, “ACR: an Adaptive [13] Babu et al., “ Enhanced Hybrid LRU Page
Cost-Aware Buffer Replacement Algorithm for Replacement Algorithm” International Journal of
Flash Storage Devices,” Eleventh International Advanced Research in Computer Science and
Conference on Mobile Data Management, IEEE Software Engineering 6(1), January - 2016, pp. 417-
Computer Society, pp 33-42 , 2010. 421
[12] Pooja Khulbe,Shruti Pant, “Hybrid (LRU) Page- [14] Yeskendir Sultanov, “Design and Implementation of
Replacement Algorithm”, International Journal of Page Replacement Algorithms based on an Inverted
Computer Applications (0975 – 8887), Volume 91 – Page Table”, International Journal of Advanced
No.16,,pp 25-28 April 2014. Engineering Technology and Application . No. 2,
35-39 (2016)

116
116 Hitha Paulson, Dr. Rajesh R

View publication stats

You might also like