In operating system how frames are allocated and what is the algorithm of allocation of frames and also discussed about Thrashing for clear some ideas! . Thank u!.
Size: 527.75 KB
Language: en
Added: May 27, 2019
Slides: 10 pages
Slide Content
Allocation of Frame & Thrashing Presented by- Arif Mollick 3rd Year(6th Sem.) CSE Dept. 11100116051
What is Allocation of Frame? Consider a single-user system with 128 KB of memory composed of pages 1 KB in size. This system has 128 frames. The operating system may take 35 KB, leaving 93 frames for the user process. Under pure demand paging, all 93 frames would initially be put on the free-frame list. When a user process started execution, it would generate a sequence of page faults. The first 93 page faults would all get free frames from the free-frame list. When the free-frame list was exhausted, a page-replacement algorithm would be used to select one of the 93 in-memory pages to be replaced with the 94th, and so on. When the process terminated, the 93 frames would once again be placed on the free-frame list. There are many variations on this simple strategy. When this space is not in use by the operating system/ it can be used to support user paging. We can try to keep three free frames reserved on the free-frame list at all times. Thus, when a page fault occurs, there is a free frame available to page into. While the page swap is taking place, a replacement can be selected, which is then written to the disk as the user process continues to execute. Other variants are also possible. The user process is allocated any free frame
Algorithm for allocation of f rame s ? The two algorithms commonly used to allocate frames to a process are: Equal Allocation of frame : Each process gets equal number of frames . Proportional Allocation of frame : Frames are allocated to each process according to the process size.
Constraints of Allocation of frames You cannot allocate more than the total number of available frames. At least a minimum number of frames should be allocated to each process. As less number of frames are allocated, there is an increase in the page fault ratio, decreasing the performance of the execution of the process. Number of allocation of frame is defined by instruction set architecture.
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 does not have enough pages,the page fault rate is very high. This leads to : Low CPU utilization. OS thinks that it needs to increase the degree of multiprogramming. Another process added to the system. A process is busy swapping page in and out. The high paging activity is called Thrashing.
Thrashing
Disadvantages of Thrashing Increase the degree of multiprogramming. System throughput decreases. Page fault rate increases. Effective access time increases.
Reduce the effect of Thrashing Using local replacement algorithm. Provides as many frames as it needs. Increase the size of memory. Decrease the number of process running.