170 likes | 396 Views
Thrashing, Allocation of frames. Recap. In the last class, you have learnt Concepts of page replacement LRU page replacement algorithm Optimal page replacement algorithm. Objective. On completion of this period, you would be able to know Thrashing Allocation of frames. Thrashing.
E N D
Recap In the last class, you have learnt Concepts of page replacement LRU page replacement algorithm Optimal page replacement algorithm
Objective On completion of this period, you would be able to know Thrashing Allocation of frames
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
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
Thrashing • A process is busy swapping pages in and out • This high paging activity is called Thrashing • More paging and less CPU utilization
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
Thrashing • To prevent thrashing provide as many frames as it needs • To know the number of frames use working set strategy
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
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
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
Frequently Asked Questions 1. Explain the concept of thrashing ? 2. Write the disadvantages of thrashing ? 3. Explain the allocation of frames ? 9CM402.43 13
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
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 15