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-
- First Fit Algorithm
- Best Fit Algorithm
- 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,
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.
![Contiguous Memory Allocation | Dynamic Partitioning](https://www.gatevidyalay.com/wp-content/uploads/2018/11/Contiguous-Memory-Allocation-Translating-Logical-Address-into-Physical-Address-Diagram.png)
![Gate Vidyalay](https://www.gatevidyalay.com/wp-content/uploads/2018/05/Gate-Vidyalay-Logo.png)