allocation of frames in operating system | allocation of frames in os | frame allocation in os

preview_player
Показать описание
#allocationofframes #frameallocation #oslectures

Operating System | Allocation of frames

An important aspect of operating systems, virtual memory is implemented using demand paging. Demand paging necessitates the development of a page-replacement algorithm and a frame allocation algorithm. Frame allocation algorithms are used if you have multiple processes; it helps decide how many frames to allocate to each process.

There are various constraints to the strategies for the 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. This constraint is supported by two reasons. The first reason is, 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. Secondly, there should be enough frames to hold all the different pages that any single instruction can reference.

Frame allocation algorithms –
The two algorithms commonly used to allocate frames to a process are:

Equal allocation: In a system with x frames and y processes, each process gets equal number of frames, i.e. x/y. For instance, if the system has 48 frames and 9 processes, each process will get 5 frames. The three frames which are not allocated to any process can be used as a free-frame buffer pool.
Disadvantage: In systems with processes of varying sizes, it does not make much sense to give each process equal frames. Allocation of a large number of frames to a small process will eventually lead to the wastage of a large number of allocated unused frames.
Proportional allocation: Frames are allocated to each process according to the process size.
For a process pi of size si, the number of allocated frames is ai = (si/S)*m, where S is the sum of the sizes of all the processes and m is the number of frames in the system. For instance, in a system with 62 frames, if there is a process of 10KB and another process of 127KB, then the first process will be allocated (10/137)*62 = 4 frames and the other process will get (127/137)*62 = 57 frames.
Advantage: All the processes share the available frames according to their needs, rather than equally.

Global vs Local Allocation –
The number of frames allocated to a process can also dynamically change depending on whether you have used global replacement or local replacement for replacing pages in case of a page fault.

Local replacement: When a process needs a page which is not in the memory, it can bring in the new page and allocate it a frame from its own set of allocated frames only.
Advantage: The pages in memory for a particular process and the page fault ratio is affected by the paging behavior of only that process.
Disadvantage: A low priority process may hinder a high priority process by not making available to the high priority process its frames.
Global replacement: When a process needs a page which is not in the memory, it can bring in the new page and allocate it a frame from the set of all frames, even if that frame is currently allocated to some other process; that is, one process can take a frame from another.
Advantage: Does not hinder the performance of processes and hence results in greater system throughput.
Disadvantage: The page fault ratio of a process can not be solely controlled by the process itself. The pages in memory for a process depends on the paging behavior of other processes as well.
Рекомендации по теме
Комментарии
Автор

Tomorrow is my university exams sir due to this online our clg did not finish the syllable, ur videos are a saviour for me thank you so much !! Expecting more videos from on various topics like ERP etc

pravinnaga
Автор

Thank you sir, its easy to understand all your classes.

amayaammu
Автор

Great Explanation sir!!
Thank you for such wonderful and useful videos..

aishwaryaveldoj
Автор

Nice explanation, keep up the excellent work.

يوسفالمطيري-نر
Автор

Sir very helpful videos thankyou so much

ArshdeepKaur-jdgu
Автор

Thanks man, I realize that i can understand your English, thank you !

anhkietofficial
Автор

Your lectures are great introduction to these OS concepts

masthikaro
Автор

helps a lot before examinations thanks a lot sir

modemharikumar
Автор

Sir, what's optimal page/frame size regarding fixed partition allocation approaches?
How to determine it?

kuldeepnishad
Автор

Sir please answer this!
Suppose, there are 3 process P1 (20 KB), P2 (15 KB), P3 (18 KB) and they have 8 KB common portion. The page size is 2 KB. If you follow the shared memory concept, how many frame do you require to store all these three processs in the physical memory? [Give a numeric value]

markrayman
Автор

Tq for the video..but Ur not looking in to the camera sir.good explanation

Blessysharonofficial
Автор

Sir very nice explanation.
But u go too close to the blackboard to write

Vishal_J.
Автор

Can we allocate the frame of high priority process to a low priority process in global replacement allocation ?
Please tell Sir.

GS
Автор

What is meant by frame in Page replacement algorithm

komatineniajay
Автор

Sir you were said u will upload Daa related videos from May 2 but I find only 2 videos sir please upload soon sir😭😭 🥺

balla
Автор

If there a more than required frame means wt is the formula

jyothijyo
Автор

Sir where r u frm?
I need some coaching classes from uplz..

tatagovind
Автор

Bey Bhai TU kiya bol rahee ha hum kon kuch samjh nhi aai

waqaskashah
visit shbcf.ru