Operating Systems-Contiguous memory allocation

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hi friends welcome to our channel in this session we will discuss contiguous memory allocation suppose a process that who wants to execute that must be in the main memory the process must be in the main memory main memory has to accommodate is assumed this is the main memory this is the main memory the main memory has to accommodate both operating system and user process both the operating system and user process suppose in this main memory that our main memory is divided into two partitions the first point is before allocation how we are dividing the main memory generally this main memory is divided into two partitions one partition is for operating system on partition for operating system another partition for user process another partition is for user process that is the process that we want to execute this is the way we are dividing main memory after that contiguous memory allocation is the name specifies contiguous means sequential sequentially we are allocating the memory suppose if your process comes that process brings one section of the memory that is contiguous to the next to process that is it up all the process the memory is allocated sequentially now we will discuss now we will discuss in the memory allocation we have two ways we have two ways of memory allocation first one is fixed size fictional cell usual partition second one variable size party second one is available mortician in these two where we are allocating memory this is memory of a conditional so first of all to fix itself partition here the total available memory if your operating system memory we are concentrating only on user process memory here the total available memory is divided into partitions of a fixer society fixer serum is the size of each partition is same for example this is the memory this is the user process memory for example has you the size of this memory is some 500 MB 500 bytes assume the size of this memory is somewhat the device now my memory is divided into fixing partitions that is the selling of this one is 100 100 this is the way I am dividing memory whenever a process comes what we will do in our process enters into the system that process is placed into the input queue a process is placed blame put you first whenever a process request for the CPU from that the process we are allocating one partition for example process p1 enters into the system it requires some memory what we will do I say this partition suppose a process p2 enters into the system it requires some memory in the similar way suppose the process p3 whenever a process enters into the system we are allocating one block of memory to the particular process one block of memory into that particular yes for example if process is process a is some ad processing is only some 80 place but the partition changes hundredweights what we will do even though the size is smaller than the available H we are locating complete 100 bytes to the process to data point whatever the size we are definitely allocating hundred bytes of number into the particular process for example if process AG's some 120 what happened for this process we have no memory is available for this process no memory is allocated this is the way we are ascending memory to the process whenever a process terminates what happens whenever a process tell myths that is complete 6 execution completes its execution this memory is made available this is the memory this is the free memory this memory is makes available for the next to process available for the next to process this is something suicided partition here how many number of process editing was simply depends on the number of partitions for example this contains five partitions we are allocating a maximum of file process take time we are getting a maximum of five process now come to variable party shirt welcome to variable partition hey what is the concept this is the main memory this is the main memory suppose this is of voice this soup memory is allocated to different process how in this operating system in variable partition operating system maintenance main takes a table it consists of two BOTS it consists of two parts water the course available memory and the allocated memory so operating system maintains a table which contains the index of available memory available memory and allocated memory suppose if you are not understanding this ones ignore this is the complete memory available initially this is the complete memory available for a process here no partition is done in fixing center partition initially we are divide memory into different blocks but in variable partition no partition is done this complete available memory initially called as full the meaning of hole is the large available free memory is output whenever a process and decimal system all the process are placed boom in computer by default process enters into the system the processes are place Ruta input queue processor place to do they put you first operating system selects a process from the input queue seller in process from the input for example process p1 is selected what is the memory requirement for this process check the memory requirement for this process for example this process requires hundred bits of memory chips are capable 100 bytes of memory is available so you got a crucial first you to pixel process and check whether the requirement remedy is available or not if the required memory is available we are allocating the process we are getting this process and update the table update the table means the hundred bytes of memory available is decreased and to pocketed suffer example first a process p1 enters into the system it occupies hundred bytes of memory as you mean usually we're assuming total 500 bytes suppose this user space added 500 bytes national process p2 enters to the system for example process p2 request so only some 70 we're allocating process p2 how much amount this is 100 this is 70 you would need compared to previous one in the previous one first to process hundred second or process 70 total 170 but in this method we are allocating 200 but in this method we are allocating only hundred plus 70 vehicle for example next to process p3 it required some 200 I am a saying in 200 next to process painful suppose requirement of process fee for his sake so how much completed 300 400 only hundred bytes of memory is available as you if process P 2 is deleted whenever a process is deleted here it forms a pool whenever a process is deleted it forms a full how much available memory no available memory is 170 this space is a hundred that phase is 70 total available memory is 170 ok whenever a process enters into the system in six the memory the other it is available allocate the memory whether it is not available simply vary the input cube whenever it causes 10 minutes each memory is free that means it is added to available memory here we have some problem of fragmentation and the end of this topic we will discuss Efrat okay similar same diagram is place we here so this is the variable same partition okay you got the clear area of fixtures engine and variable sense fixed research means we divide into partitions of sources variable means whenever a process comes yeah we do the free available space when every ten minutes you have to the operating system table okay in this memory allocation in this memory allocation we are getting a problem the problem is dynamic storage allocation dynamic storage allocation problem occurs what is the problem how we are dynamically allocates in process to the memory suppose I am requesting a memory of say GM in bags suppose I am requesting a memory of sighs Ian how you will satisfy your requests okay how we are satisfy your requests so for this dynamic storage allocation will hold three check strategies one is first to feel best to field wash sweet by using these three ways we're dynamically allocating the process of our request okay for example this is the memory after some insertions or deletions the memory is divided of different sizes assume this is some 150 some 200 150 suppose 350 these are sizes of each block as you these are this Ignace of each block first to follow the first two filter rules what is the first filter approach whenever a process requests for the memory in the first two field we are searching from the starting assume we are sent from the first off reward if a first to free world is sufficient for the particular process if the whole is sufficient for the process we are allocating suppose my request suppose a process a process of says 150 how we are allocating a memory in the first effect approach we are checking for a free whole that is big enough to store the process first to P is typically this is 100 it is not sort of cool this size is 50 it is not suitable what is the size of this process here the block memory size is 200 or 150 is storing this position so P is stolen suppose a p1 p1 is stored in this position as you P do suppose size of p2 is some 200 size of people is 200 NSA to from starting position or we have one more way always we sell to further required from the starting position ah since from previous witch doctor position that is we have use it from this position or from this position suppose I am searching from starting position the size is 100 it is not sufficient the free size is 50 these are the three sizes the free stages should be not sufficient here the size is 200 but it is already allocated even though the size is reached it is already allocated 150 not sufficient 300 so we place process P 2 with less process people this is the first fit approach that is we are searching well the first of all that is big enough to store the particular process observe by observing suppose if we have one more process P 3 essentially hundred where we are storing 300 that is where we used to be 3 so the first effect approach is not suitable move to best fit approach go to benefit approach suppose this is first this is first in the best effect approach from the starting to ending we says the best fit approach from the starting memory free location due into free location we says well it exactly fits that is the lowest to possible requirement for example first process 5150 the size is 100 not sufficient 50 are sufficient 200 even though it is sufficient scan the entail memory so once you pay and 150 exactly same so process P 1 is allocated the best of it process P 1 is allocated suppose if process ID is 140 need is 2 to 1 4 is 150 so 150 is allocated next to process P 2 so again start from message process P 2 is allocated in best effect process p3 also have same space see this one in the FASTA field in the first appeal process p3 is not allocated but by using bestival process p3 is allocated okay and mu2 washed away wash to Brittany is similar to best of it exactly was in Festival we searched the until free memory locations that is best to suitable is allocated in this century in detail location that is lush squash to sort of cool that is the wash to suitable location for example 151st to process one is allocated to the god just pull so what is the largest pool 300 so process p1 is allocated at this position process p2 next one is we do I just do 50 this is the Vashta position next to p3 there is no way to space this is the way to allocate the memory this is the problem of dynamic storage allocation these dynamic storage allocation problem is solved by using any of these things remember next to fit first of it wash to fit all those are there is no guarantee that which one is next depending on situations in one situation first if it is better than best fit you think that in this situation best fit is better but depending on the situation first fit is better than yesterday and worst of it it always cements more vegetables in dynamic storage allocation problem and obvious is clear and will do previous one so what we will discuss in the future sized partition our variable sized partition suppose a partitions are it is hundred bytes 40 cents ages under beds if my processor is only 70 beds whatever the main is the by its whatever term any 30 bytes that is all fragmentation fragmentation means simply wastage of memory fragmentation means wastage of memory so here 30 bytes of memories we should see the previous example you have even though the requirement is 70 pipes but I am allocating hundreds the 30 bytes of memory station we have two types of fragmentations one means internal fragmentation second one is external fragmentation so we know internal fragmentation internal fragmentation is this one this is the internal fragmentation suppose the size is 100 the size is 100 100 divided into fixtures edges partition suppose I am allocating a process each of memory 90 what about these remaining 10 bytes suppose I get a process of samadhi remaining activates remaining 10 bytes so it is waged internal internal means we are allocating the memory to this partition I am allocating the memory I am are getting this partition but it wished 10 bytes of memory this is called frag protection but you do external fragmentation this is the important one what is external fragmentation suppose the available memory suppose the required memory is available but it is not continuous it is not contiguous for example I have a process of sage 100 what we will do so 100 is available simply allocates if I want to store your process of size 150 what we will do here the total available memory in this system is 70 plus 100 170 I am required only 150 but it is not allocated because this 70 and 100 are not contiguous this is called external fragmentation so external fragmentation means the required memory is available but the memory is not contiguous that is the memory is not a sequential that is called external fragmentation what we will do to overcome external fragmentation one technique is compaction or technique is compaction compaction means whenever a process terminates whenever a process table is that the free memory is added to the already available memory the free memory is added to already available number is that me is after performing compaction what happens P 1 it is stored this memory is added to this available block P 3 of size 200 P 4 of this is remaining 170 okay compaction is all available whose whole miss free memory is cut put that is available memory is carful all holes are combined into a single large pool that is some action now my requirement one day I am allocating 150 in the 170 in this way I am overcoming external fragmentation this is the contiguous memory allocation techniques
Info
Channel: t v nagaraju Technical
Views: 15,654
Rating: 4.94382 out of 5
Keywords: Contiguous memory allocation, dynamic storage allocation problem, how to allocate memory in contiguous allocation, types of memory allocation, fixed sized partiotion, varaible partition, fragmentation, internal fragmentation, external fragmentation, solution to external fragmentation, compaction, how to solve external fragmentation, how to allocate memory using first fit, how to allocate memory using best fit, how to allocate memory using worst fit, tv nagaraju technical
Id: DiNvM5EXHpA
Channel Id: undefined
Length: 21min 19sec (1279 seconds)
Published: Mon Sep 09 2019
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.