Professional Documents
Culture Documents
Thrashing
• In global replacement, a high priority process can take frames from a low
priority process.
• If the number of frames allocated to a low priority process falls below the
minimum number of required by the computer architecture then we must
suspend that process’s execution.
• If the process does not have the number of frames it needs to support
pages in active use, it will quickly page fault.
• At this time, it must replace some page. Since all its pages are in active
use, it must replace a page that will be needed again right away.
• Consequently, it quickly faults again and again , and again, replacing pages
that it must bring back in immediately.
Þ This high paging activity is called thrashing.
Þ A process is thrashing if it is spending more time on paging than
executing.
1
Thrashing: system is spending a major portion of its time in servicing the
page faults, but the actual processing done is very negligible.
C
6
A
8
C takes 2 B
frames 7 A takes 2 frames
from B from X using global
using replacement
global B takes 2 allocation policy.
replacem frames from
ent A using
allocation global
policy. replacement
allocation
2
policy.
OPERATING SYSTEM
Thrashing
3
OPERATING SYSTEM
Causes of Thrashing
4
Prevention of thrashing
• Working set model
• Page fault frequency
5
OPERATING SYSTEM
Prevention of Thrashing
6
OPERATING SYSTEM
Prevention of Thrashing
7
OPERATING SYSTEM
Prevention of Thrashing
8
Working set model
• This technique prevents thrashing along with ensuring the highest
degree of multiprogramming possible. Thus, it optimizes CPU
utilisation.
9
OPERATING SYSTEM
Prevention of Thrashing
Advantages:
•Working-set strategy prevents thrashing
• Degree of multiprogramming will be high
Disadvantages:
• Keeping track of working set
• Working set is a moving window
• Clumsy way to control thrashing
10
OPERATING SYSTEM
Prevention of Thrashing
11
12
Advantage
• Direct way to control thrashing
• Directly measures and control the page fault rate
13