Skip to main content

Types Of Memory Allocation


  Now we are ready to read about various types of memory allocation. One of the simplest methods for allocating memory is to divide memory into several Fixed-Sized partitions. Each partition may contain exactly one process. In this multiple partition method, when a partition is free, a process is selected from the input queue and is loaded into the free partition. When the process terminates, the partition becomes available for another process. But this method is no longer in use.

  In the Variable-Partition scheme, the operating system keeps a table indicating which parts of memory are available and which are occupied. All the memory is available for user processes and is considered one large block of available memory, called hole. Eventually memory contains a set of holes of various sizes. As processes enter the system, they are put into an input queue. And when a process is allocated space, it is loaded into memory and it canthen compete for CPU time. When a process terminates, it releases its memory, which the operating system may then fill with another process.

  In general, as mentioned, the memory blocks available comprise a set of holes of various sizes scattered throughout memory. When a process arrives and needs memory, the system searches the set for a hole that is large enough for this process. If the hole is too large, it is split into two parts. One part is allocated to the arriving process and the other one is returned to the set of holes. When a process terminates, it releases its block of memory, which is then placed back in the set of holes. If the new hole is adjacent to other holes, these adjacent holes are merged to form one larger hole. 

This procedure is a particular instance of the general dynamic storage
allocation problem. There are many solutions to selecting a free hole from the set of available holes as follows :-

 i>  First Fit :- It allocates first hole that is big enough. The searching can start from begining of the list.




ii> Best Fit :- It allocate the  first smallest sufficient hole or partition.We must search the entire list, unless list is ordered by size. It produces smallest leftover space.




iii> Worst Fit :- It allocate the hole or partition which is the largest. It produces the largest leftover space.




iv> Next Fit :- It is similar to the first fit but it will search for the first sufficient partition from the last allocation point.




Although best fit minimizes the wastage space, it consumes a lot of processor time for searching the block which is close to the required size. Also, Best fit may perform poorer than other algorithms in some cases. SO we can not say best fit is actually best as its name. Neither first fit nor best fit is clearly better than the other in terms of storage utilization, but first fit is generally faster.




click here for contigeous memory allocation.

Share, Follow and please comment if you find anything incorrect or to share more information about the topic discussed above.

Comments

Popular posts from this blog

Process Scheduling And Types of Process Schedular :-

        ⇰ PROCESS SCHEDULING Process Scheduling  is a task  of Operating System that schedules processes of different states like new, ready, waiting, terminated  and running.This scheduling helps in allocation of CPU time for each process, and Operating System allocates the CPU time for each procss. And the process scheduling plays important role to keep the CPU busy all the time.  ⏩   Followings are some objectives of Process Scheduling :-  i > To increase the amount of users within acceptable response times.  ii > To maintain the balance between response and utilization of system. iii > To decrease the enforce priorities and  give reference to the processes holding the key resources.      ⇰  PROCESS SCHEDULAR A scheduler carries out the pro cess scheduling work. Schedulers are often implemented so they keep all computer resources busy and  allows multiple users to share system resources  to achieve  multiprogramming .  There are  mainy three types of pro

Tokens and its types in 'C'

   Tokens are the smallest individual unit of a program or in simple words it is a main part of C program.Tokens are the building blocks of any program. The smallest individual and basic unit of a C programming is called c tokens.      *    Normally there are six types of tokens in C:- i> Keywords:-          Keywords are special words that are used to give a special meaning to the program and can't be used as variable and constant.They are basically a sequence of characters that have fixed to mean. For example:-                 auto     double      long     break                 float    short        char     if                while    continue   int       void etc. All keywords must be written in lower case.It is 32 in number. ii> Identifiers:-         The identifiers are basically a token. It can be a variable's name or a label's name. So identifiers are actually a user defined data. But there are certain rules to frame an identifier. They are as follo

Micromax 'The Indian Smart Phone Company'

Micromax  is an Indian  consumer electronics  company headquartered in  Gurgaon ,  Haryana . It was established as an  IT   Software  company operating in the  Embedded Devices   Domain . It later entered the  Mobile   Handset  business. Micromax was incorporated as Micromax Informatics Ltd. on 29 March 2000 by Zeeshan Ali Zaidi. It began selling mobile telephones in 2008,  focusing on  low pricing to compete with international brands. By 2010, Micromax was one of the largest domestic companies making handsets in the low-cost feature phone segment in India. As of Q3 2014, Micromax is the  Tenth Largest   Smart phone  vendor in the world. The company is facing stiff competition from Chinese companies that are penetrating the Indian market. The company also owns  YU Televentures , which sells its products under the brand name YU. The company has also introduced handsets with innovative features. For instance, Micromax's co-founder  Rahul Sharma  once saw a  public call