2. HOME PREVIOUS TOPIC NEXT
PREVIOUS QUESTION PAPERS FOR OS
CPP TUTORIALS
http://raj-os.blogspot.in/ 2
3. Recap
In the last class, you have learnt
Concepts of thrashing
Allocation of frames
http://raj-os.blogspot.in/ 3
4. Objective
On completion of this period, you would be able
to know
Working set model
Page fault frequency
http://raj-os.blogspot.in/ 4
5. Working Set Model
The pages used by a process within a window of
time are called its working set
The working-set model is based on the assumption of
locality
…2 6 1 5 7 7 7 7 5 1 6 2 3 4 1 2 3 4 4 4 3 4 3 4 4 4 1 3 2 3 4
WS(t1) = {1,2,5,6,7} WS(t2) = {3,4}
Changes continuously - hard to maintain an accurate
number
How can the system use this number to give optimum
memory to the process?
http://raj-os.blogspot.in/ 5
6. Working Set Model
defines the working set window
If a page is in active use, it will be in the working
set
If it is not in the use, it will be drooped from the
working set
Working – set is the approximation of the
program’s locality
The accuracy of the working set depends on the
selection of the
http://raj-os.blogspot.in/ 6
7. Working Set Model
Important property of the working set is the size
Compute working set size for each process in
the system WSSi
D=ΣWSSi, where D is the total demand for
frames
If D>m where m is the total no. of available
frames thrashing will occur
The operating system monitors the working-set
of each process and allocates them enough
frames
http://raj-os.blogspot.in/ 7
8. Working Set Model
Working-set strategy prevents thrashing
Degree of multiprogramming will be high
Disadvantage
Keeping track of working set
Working set is a moving window
http://raj-os.blogspot.in/ 8
10. The Working Set Model
The working set is the set of pages used by
the k most recent memory references
w(k,t) is the size of the working set at time, t
http://raj-os.blogspot.in/ 10
11. Steps in handling a Page Fault
The process has touched a page not currently
in memory
Check an internal table for the target process
to determine if the reference was valid (do this
in hardware)
If it was valid, but page isn't resident, then try
to get it from secondary storage
Find a free frame; a page of physical memory
not currently in use (May need to free up a
page)
http://raj-os.blogspot.in/ 11
12. Steps in handling a Page Fault
Schedule a disk operation to read the desired
page into the newly allocated frame
When memory is filled, modify the page table to
show the page is now resident
Restart the instruction that failed
Repeat these steps
http://raj-os.blogspot.in/ 12
13. Page Fault Frequency
This is a good indicator of thrashing
If the process is faulting heavily, allocate it more
frames
If faulting very little, take away some frames
http://raj-os.blogspot.in/ 13
14. Summary
In this class, you have learnt
Working set model
Page fault frequency
http://raj-os.blogspot.in/ 14
14
15. Frequently Asked Questions
1. Explain the working-set model ?
2. Explain the page fault frequency ?
http://raj-os.blogspot.in/
9CM402.44 15
15
16. Quiz
1. If a page is in active use, it will be in the
a) FIFO
b) LRU
c) Working set
d) None
2. Important property of the working set is the
a) FIFO
b) LRU
c) Size
d) None
http://raj-os.blogspot.in/ 16
16
17. Quiz
3. Working – set is the approximation of the program’s
a) Locality
b) LRU
c) FIFO
d) None
4. D=ΣWSSi, where D is the total demand for
a) LRU
b) Frames
c) FIFO
d) None
http://raj-os.blogspot.in/
9CM402.44 17
17
18. Other subject materials
• Web designing
• Micro processors
• C++ tutorials
• java
home
http://raj-os.blogspot.in/ 18