Thrashing allocation frames.43

myrajendra 12,311 views 21 slides Mar 18, 2013
Slide 1
Slide 1 of 21
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21

About This Presentation

No description available for this slideshow.


Slide Content

http://raj-os.blogspot.in 1
Thrashing, Allocation of frames

http://raj-os.blogspot.in 2
HOME PREVIOUS TOPIC NEXT
PREVIOUS QUESTION PAPERS FOR OS
CPP TUTORIALS

http://raj-os.blogspot.in 3
Recap
In the last class, you have learnt
•Concepts of page replacement
•LRU page replacement algorithm
•Optimal page replacement algorithm

http://raj-os.blogspot.in 4
Objective
On completion of this period, you would be
able to know
•Thrashing
•Allocation of frames

http://raj-os.blogspot.in
Thrashing
•Swapping out a piece of a process just before
that piece is needed
•The processor spends most of its time swapping
pieces rather than executing user instructions
•This activity is called the thrashing
5

http://raj-os.blogspot.in 6
Thrashing
If a process does not have “enough” pages, the
page-fault rate is very high. This leads to:
•Low CPU utilization
•Operating system thinks that it needs to
increase the degree of multiprogramming
•Another process added to the system

http://raj-os.blogspot.in 7
Thrashing
•A process is busy swapping pages in and out
•This high paging activity is called Thrashing
•More paging and less CPU utilization

http://raj-os.blogspot.in 8
Thrashing
Disadvantages
•Increases the degree of multiprogramming
•System throughput decreases
•Page fault rate increases
•Effective access time increases
•This phenomenon is shown in next slide

http://raj-os.blogspot.in 9
Thrashing

http://raj-os.blogspot.in 10
Thrashing
•We can reduce the effect of thrashing by using
the local replacement algorithm
•To prevent thrashing provide as many frames as
it needs
•To know the number of frames use working set
strategy

http://raj-os.blogspot.in 11
Thrashing
Why does paging work?
Locality model
Process migrates from one locality to another
Localities may overlap
Why does thrashing occur?
S size of locality > total memory size

http://raj-os.blogspot.in
Principle of Locality
•Program and data references within a process
tend to cluster
•Only a few pieces of a process will be needed
over a short period of time
•Possible to make intelligent guesses about
which pieces will be needed in the future
•This suggests that virtual memory may work
efficiently
12

http://raj-os.blogspot.in 13
Locality In A Memory-Reference Pattern

http://raj-os.blogspot.in 14
Allocation of Frames
• Each process needs minimum number of
pages
• Consider a single OS with 128K memory,
with page size of 1K
•OS takes 35K, Leaving 93 frames for the user
process

http://raj-os.blogspot.in
Allocation of Frames
•The first 93 page faults would get free frames
from the free frame list
•When the free frame list is exhausted a page
replacement algorithm is used to allocate the
frame
15

http://raj-os.blogspot.in 16
Allocation of Frames
Constraints
•Can not allocate more than the total no. of
available frames
•Only a minimum no. of frames that can be
allocated
•This no. is defined by the instruction set
architecture
•As the no. of frames allocated decreases the
page fault increases
•Slows down the process execution

http://raj-os.blogspot.in 17
Summary
In this class, you have learnt
•Concept of Thrashing
-High paging activity is called Thrashing
•Allocation of frames

http://raj-os.blogspot.in9CM402.43 18
18
Frequently Asked Questions
1. Explain the concept of thrashing ?
2. Write the disadvantages of thrashing ?
3. Explain the allocation of frames ?

http://raj-os.blogspot.in 19
Quiz
1. ___________Increases the degree of multiprogramming
a) FIFO
b) LRU
c) Thrashing
d) None
2. High paging activity is called __________
a) FIFO
b) LRU
c) Thrashing
d)None

http://raj-os.blogspot.in 20
20
Quiz
3. Each process needs ________number of pages
a) Minimum
b) LRU
c) FIFO
d) None
4. We can reduce the effect of thrashing by using the
a) LRU
b) Local replacement algorithm
c) FIFO
d) None

Other subject materials
•Web designing
•Micro processors
•C++ tutorials
•java
home
21http://raj-os.blogspot.in
Tags