The process of dynamic partitioning is a part of the contiguous memory allocation technique. It is primarily used for alleviating the problems faced due to fixed partitioning. Unlike fixed partitioning, partitions aren’t created in dynamic partitioning unless and until a process gets executed.
In this article, we will look more into the Dynamic Partitioning in Operating System according to the GATE Syllabus for (Computer Science Engineering) CSE. We will read ahead to find out more about it.
Table of Contents
- What is Dynamic Partitioning in Operating Systems?
- Pros of Dynamic Partitioning in Operating System
- Cons of Dynamic Partitioning in Operating System
What is Dynamic Partitioning in Operating Systems?
Dynamic partitioning helps in overcoming the difficulties caused by the process of fixed partitioning. In dynamic partitioning, the partition size initially isn’t declared. It’s declared at the moment of process loading.
The very first partition has to be reserved for the OS. The left space gets divided into various parts. The actual size of every partition would be equal to the process size. The size of the partition varies according to the requirement of the process. This way, internal fragmentation can be easily avoided.
Pros of Dynamic Partitioning in Operating System
1. No Internal Fragmentation
Since the partitions present in dynamic partitioning are only created according to the requirement of the process, there won’t be any internal fragmentation since there won’t be any remaining unused space in the given partition.
2. No Limitation on the Process Size
In the case of fixed partitioning, the process that has a size greater than the actual size of the largest partition couldn’t be executed because of the shortage of sufficient contiguous memory. On the other hand, the process size can’t be restricted in dynamic partitioning because the size of the partition is decided in accordance with the size of the process.
3. Dynamic Degree of Multiprogramming
Since there is no internal fragmentation, there won’t be any unused, unutilised space in the partition. Thus, more processes could be loaded at the same time in the memory.
Cons of Dynamic Partitioning in Operating System
1. External Fragmentation
Since there is no internal fragmentation, it doesn’t mean there would be no external fragmentation either.
Now, let us consider three processes, i.e. P1 (1 MB), P2 (3 MB) and P3 (1 MB), that are being loaded in their respective partitions of the main memory. P1 and P3 get completed after some time, and the assigned space gets freed. Here, we have two unused partitions available (both 1MB) in the main memory. However, we can’t use them to load 2MB processes in the memory because they aren’t located contiguously.
This rule says that a process has to be present contiguously in the main memory so as to get executed. One needs to change this rule in order to avoid external fragmentation.
2. Complex Memory Allocation
In the case of fixed partitioning, the overall list of partitions is created once, and it won’t ever change. However, the deallocation and allocation are very complex in dynamic partitioning because the partition size would be varied every single time when it’s assigned to any new process. The OS must keep track of all of the partitions.
Since deallocation and allocation are very frequently done in dynamic allocation and the size of the partition gets changed each time, it’s always going to be absolutely difficult for the OS to manage every single thing.
Keep learning and stay tuned to get the latest updates on GATE Exam along with GATE Eligibility Criteria, GATE 2023, GATE Admit Card, GATE Syllabus, GATE Previous Year Question Paper, and more.
Also Explore,
- Batch Operating System
- Binary Semaphores in Operating System
- Contiguous Memory Allocation in Operating System
- Counting Semaphores in Operating System
- Deadlock Detection and Recovery in Operating System
- Deadlock Prevention in Operating System
- Distributed Operating System
- Fixed Partitioning in Operating System
- Functions of Operating System
- Operating System GATE Questions
- Methods for Handling Deadlock in Operating System
- Multiprocessing Operating System
- Multiprogramming Operating System
- Multitasking Operating System
- Network Operating System
- Non-Contiguous Memory Allocation in Operating System
- Operating System Services
- Paging in OS
- Process in Operating System
- Process Scheduler in Operating System
- Process Scheduling in Operating System
- Process State in Operating System
- Real-Time Operating System
- Resource Allocation Graph in Operating System
- Semaphores in Operating System
- Time-Sharing Operating System
- Types of Operating System