Thursday, June 27, 2019

Operating Systems - Memory Allocation Method

The main memory must be accommodate both Operating System and various user processes. The Operating System place in either low memory or high memory. There are so many method available for memory allocation like : 
  • Single Partition Allocation
  • Fixed Equal Multiple Partition Allocation
  • Fixed Variable Partition Allocation
  • Dynamic Partition Allocation

1. Single Partition Allocation :  

In this memory allocation method the Operating System reside in low memory and the remain memory is treated as single partition which only available for user space. The short term or CPU scheduler selects a job from ready queue the departure loads that job into main memory and connect CPU to that job.

Advantages :  
  1. The main Advantage of this scheme is its simplicity.
Disadvantages : 
  1. Poor utilization of the processor. 
  2. Poor utilization of memory. 

2. Fixed Equal Multiple Partition Allocation :

In this scheme the OS occupies the low memory and rest of main memory is available for user space. The user space is divided into fixed partition depending on OS. For example, total main memory size is 6MB, 1MB occupied by OS and remaining 5MB partitioned into  equal fixed Partitions.

Advantages:
  1. It supports multi-programming.
  2. It require most special costly hardware.
Disadvantages :
  1. This scheme suffers from internal as well as external fragmentation.  
  2. It does more memory then a single partition method. 

3. Fixed Variable Partition Allocation :

In this  scheme the user space divide into number of fixed  partitions, but the partition size are different length. Operating System keep a table indicating which partition of memory are occupied or which are available. When a process is arrive and need memory, it search for partition large enough for this process. There are 3-types of algorithm available to build this.
  •  First Fit :   Allocate the partition that is big enough. Searching can start either from low memory or high memory, we can stop searching as we find a free partition that is large enough.
  • Best Fit :  Allocate the smallest partition that big enough which having least internal fragmentation.
  • Worst Fit :  Search entire partition and select a partition which is largest of all or select a partition which having maximum internal fragmentation.
Advantages :
  1.  this scheme  support multi-programming.
  2. Efficient processor utilization and memory utilization is possible.
Disadvantages :
  1.  It suffers from internal and external fragmentation.

4. Dynamic Partition Allocation :

To eliminate all disadvantages of fixed Partition, a new approach is introduce known as Dynamic Partition. In this method, partitions are created dynamically so that each process is loaded into partition of exactly the same size at that process. In this scheme boundary partition are dynamically changed and the boundaries are depend on size of processes. 

Advantages :
  1.  Though the partition are changed dynamically does not suffer from internal fragmentation.
  2. Efficient memory and processor utilization.
Disadvantages :
  1.   This scheme suffering from external fragmentation.

No comments:

Post a Comment

Fortnite’s Turbo Building Time Delay Change Rolled Back by Epic Games After Backlash

Photo source : Epic Games Epic Games has had a rough couple of weeks. First, it was the B.R.U.T.E mechs in Fortnite that caused outrag...