/    /  OS – Contiguous Memory Allocation in Operating System

Contiguous Memory Allocation in Operating System

 

A contiguous memory allocation is a memory management technique where whenever there is a request by the user process for the memory, a single section of the contiguous memory block is given to that process according to its requirement. 

 

It is achieved by dividing the memory into fixed-sized partitions or variable-sized partitions.

 

Fixed-sized partition scheme: 

It is also known as Static-partitioning. 

The system is divided into fixed-sized partitions.

 

In this scheme, each partition may contain exactly one process. This process limits the extent of multiprogramming, as the number of partitions decides the number of processes. 

 

Advantages of Fixed-sized partition scheme:

 

The advantages of fixed-sized partition scheme are as follows:

  1. This scheme is easy to implement.
  2. It makes management easier.
  3. It supports multiprogramming.

 

Disadvantages of Fixed-sized partition scheme:

 

The disadvantages of fixed-sized partition scheme are as follows:

  1. It limits the extent of multiprogramming.
  2. The unused portion of each partition cannot be used to load other programs. 
  3. The size of the process cannot be larger than the size of the partition, hence limiting the size of the processes.

 

Variable-sized partition scheme:

 

It is also known as Dynamic partitioning. In this, the scheme allocation is done dynamically. 

 

The size of each partition is not declared initially, and only once we know the size of the process. The size of the partition and the process is equal, hence preventing internal fragmentation. 

 

When the process is smaller than the partition, some size of the partition gets wasted, this is known as internal fragmentation. It is a concern in static partitioning, but dynamic partitioning aims to solve this issue. 

 

Advantages of Variable-sized partition scheme:

 

The advantages of a variable-sized partition scheme are as follows:

  1. There is no internal fragmentation.
  2. The degree of multiprogramming is dynamic.
  3. There is no limitation on the size of the processes. 

 

Disadvantages of Variable-sized partition scheme:

 

The disadvantages of a variable-sized partition scheme are as follows:

  1. It is challenging to implement.
  2. It is prone to external fragmentation. 

 

Reference

Contiguous Memory Allocation in Operating System