Contiguous Memory Allocation | Dynamic Partitioning

Spread the love

Contiguous Memory Allocation-

 

Before you go through this article, make sure that you have gone through the previous article on Contiguous Memory Allocation.

 

We have discussed-

  • In contiguous memory allocation, a process can be stored only in a contiguous fashion.
  • There are two popular techniques used for contiguous memory allocation-

 

 

In this article, we will discuss about Dynamic Partitioning.

 

Dynamic Partitioning-

 

  • Dynamic partitioning is a variable size partitioning scheme.
  • It performs the allocation dynamically.
  • When a process arrives, a partition of size equal to the size of process is created.
  • Then, that partition is allocated to the process.

 

Partition Allocation Algorithms-

 

  • The processes arrive and leave the main memory.
  • As a result, holes of different size are created in the main memory.
  • These holes are allocated to the processes that arrive in future.

 

Partition allocation algorithms are used to decide which hole should be allocated to the arrived process.

 

Popular partition allocation algorithms are-

 

 

  1. First Fit Algorithm
  2. Best Fit Algorithm
  3. Worst Fit Algorithm

 

We have already discussed these algorithms in our previous article.

 

Important Points-

 

Point-01:

 

For dynamic partitioning,

  • Worst Fit Algorithm works best.
  • This is because space left after allocation inside the partition is of large size.
  • There is a high probability that this space might suit the requirement of arriving processes.

 

Point-02:

 

For dynamic partitioning,

  • Best Fit Algorithm works worst.
  • This is because space left after allocation inside the partition is of very small size.
  • There is a low probability that this space might suit the requirement of arriving processes.

 

Translating Logical Address into Physical Address-

 

The following diagram illustrates the steps of translating logical address into physical address-

 

 

The steps are same as we have discussed in our previous article.

 

Advantages-

 

The advantages of dynamic partitioning are-

  • It does not suffer from internal fragmentation.
  • Degree of multiprogramming is dynamic.
  • There is no limitation on the size of processes.

 

Disadvantages-

 

The disadvantages of dynamic partitioning are-

  • It suffers from external fragmentation.
  • Allocation and deallocation of memory is complex.

 

To gain better understanding about Contiguous Memory Allocation,

Watch this Video Lecture

 

Next Article- Practice Problems On Contiguous Memory Allocation

 

Get more notes and other study material of Operating System.

Watch video lectures by visiting our YouTube channel LearnVidFun.

Summary
Contiguous Memory Allocation | Dynamic Partitioning
Article Name
Contiguous Memory Allocation | Dynamic Partitioning
Description
Contiguous Memory Allocation in OS allows to store the process only in contiguous fashion. Dynamic partitioning and Static partitioning are the two contiguous memory allocation techniques.
Author
Publisher Name
Gate Vidyalay
Publisher Logo

Spread the love