×

Fixed Partitioning in Operating System

Fixed Partitioning in OS

Fixed Partitioning is also known as Contiguous memory allocation. Fixed Partitioning is the easiest method, which is used to load more than one process into the main memory.

In Fixed Partitioning, we divide the main memory into partitions, and the size of partitions can be different or equal. In the first partition, the operating system is present, and the remaining partitions are used to store the user processes. In a contiguous way, we allocate the memory to the processes.

In the fixed Partitioning:

  1. There is no overlapping of partitions.
  2. For the process execution, the process should be present contiguously.

Disadvantages of Fixed Partitioning

The disadvantages of Fixed Partitioning are:

  1. Internal Fragmentation: - In fixed partitioning, the partitions will be wasted and remain unused if the process size is lesser than the total size of the partition. In this way, memory gets wasted, and this is called Internal fragmentation.

We can see in the fixed partitioning diagram that for loading a process of 3 MB, we use the partition of 4 MB, and in this way, 1 MB is getting wasted. Thus, this is the drawback of fixed partitioning.

  • External Fragmentation: - We cannot use the total amount of unused space of different partitions to put the process even in the situation when we have some space available, but not in contiguous form. We can see in the fixed partitioning diagram, that we cannot use the 1 MB remaining space of each of the partition to store the process of 4 MB. Instead of that, we have a space available to load the process, but we cannot load the process. Such type of fragmentation is known as External Fragmentation.
  • Limitation on the Size of the Process: - Sometimes, when the size of the process is larger than the maximum partition size, then we cannot load that process into the memory. So, this is the main disadvantage of the fixed partition.
  • Degree of Multiprogramming is Less: - We can understand from the degree of multiprogramming that it means at the same time, the maximum number of processes we can load into the memory. In Fixed Partitioning, the size of the partition is fixed, and we cannot vary it according to the process size; therefore, in fixed partitioning, the degree of multiprogramming is less and fixed.
Fixed Partitioning

Dynamic Partitioning: - Dynamic Partitioning is another technique for memory management that is invented to remove the problems that arises in the Fixed Partitioning technique. In dynamic partitioning, we do not declare the size of the partition in the starting. Instead, we declare the size of partition at the time of its loading.

In this, the operating system, reserves the first partition. The rest of the other space is divided into different sections. The size of the partition and the size of the process remain equal. In dynamic partitioning, we can avoid the problem of internal fragmentation by varying the size of partition based on the needs of the process.

Fixed Partitioning

Advantages of Dynamic Partitioning over Fixed Partitioning

The advantages of dynamic partitioning over fixed partitioning are:

  1. No Limitation on the size of the process: - In fixed partitioning, if the size of the process is larger than the size of the partition, we cannot put or load the process into the memory. But if we talk about dynamic partitioning, the size of the process cannot be fixed, and we can change the size of partition according to the size of the process.
  2. The Degree of Multiprogramming is dynamic: -In Dynamic Partition, there is no internal fragmentation, so there is no unused space that is present in the partition. So at the same time, we can load more number of processes in the memory.
  3. No Internal Fragmentation: - In Dynamic Partitioning, the partitions are created dynamically as per the need for the process. So, in dynamic partitioning, internal fragmentation is not present, and the reason behind is that in dynamic partition, there is no space in the partition which remains unused.

Disadvantages of dynamic partitioning

The disadvantages of dynamic partitioning are:

  1. Complex Memory Allocation: - In the case of fixed Partitioning, if once we create the list of partitions, we cannot modify it again. But in the case of dynamic partition, the task of allocation and deallocation is tough because the size of the partition varies whenever the partition is allocated to the new process. The operating system has to keep track of each of the partitions.

So, due to the difficulty of allocation and deallocation in the dynamic memory allocation, and every time we have to change the size of the partition; therefore, it is tough for the operating system to handle everything.

  • External Fragmentation: - One of the main disadvantages of dynamic partitioning is external fragmentation.

Suppose we have three processes P1 (1MB), P2 (3MB), and P3 (1MB), and we want to load the processes in the various   partitions of the main memory.

Now the processes P1 and P3 are completed, and space that is assigned to the process P1 and P3 is freed. Now we have partitions of 1 MB each, which are unused and present in the main memory, but we cannot use this space to load the process of 2 MB in the memory because space is not contiguous.

The rule says that we can load the process into the memory only when it is contiguously residing in the main memory. So, if we want to avoid external fragmentation, then we have to change this rule.

Fixed Partitioning

What is Compaction

Compaction is also known as Defragmentation. In dynamic Partitioning, there is a problem of external fragmentation, and due to external fragmentation, some critical problems can happen.

If we want to remove the problem of compaction, we have to change the rule that says, in memory, we cannot store the process in different places. Compaction is also used to reduce the possibility of external fragmentation. In this, the partitions which are free are made contiguous, and all the partitions which are loaded are carried together.

With the help of compaction, we can easily store the processes in the memory that are bigger in size.

In this, free partitions are merged and then used. These merged partitions are allocated to other processes according to their need.

We can see in the below figure, there is process P5 which we cannot load into the memory because we don’t have space in a contiguous manner. But with the help of the compaction technique, we can load the process P5 in the memory because, by the compaction technique, we made the free partitions contiguous.

Fixed Partitioning

Problem with Compaction

Due to compaction, the system efficiency is decreased because we need to move all the free spaces from one place to other.

In this way, the more amount of time is wasted, and the CPU remains ideal all the time. Instead of that, with the help of compaction, we can avoid external fragmentation, but this will make the system inefficient.


Related Topics

CPU Scheduling in OS

What is Scheduling? Scheduling is the process that is used to share the computing resources such as memory, processor time, and bandwidth to the different processes, data flows, threads, and applications that need...

5 minutes read.

What is Deadlock in OS?

Deadlock in Operating System In an Operating System, a process uses various resources, and the resources are used in the following manner: Request the ResourceUse the ResourceRelease the Resource In the Operating System, Deadlock is a condition...

4 minutes read.

Ubuntu Operating System

Ubuntu Operating System Ubuntu is an open-source and a Linux based operating system. Ubuntu is developed for the Network Servers, Computers, and Smartphones. The Ubuntu operating system was developed by Canonical...

3 minutes read.

Memory Management in Operating System

The term "Main Memory" refers to the computer's internal physical memory. It is distinguished from external mass storage devices like disk drives by using the term "main." RAM is another...

4 minutes read.

File Allocation Methods in Operating System

A file allocation method is a way that an operating system stores and retrieves files on a storage device, such as a hard drive or SSD. The file allocation method...

4 minutes read.

DOS Operating System

What is DOS Operating System? An operating system that runs from a hard disk drive is known as the DOS (Disk Operating System).In other words, DOS (Disk Operating System) is defined...

7 minutes read.

Multiprogramming Operating System

You will discover more about the multiprogramming operating system in this post, including how it functions and its benefits and drawbacks. Each process needs several types of system time, including CPU...

4 minutes read.

Deadlock Detection and Recovery

Deadlock Detection and Recovery In deadlock detection and recovery, to avoid or prevent a deadlock, the operating system uses various methods. For checking deadlock, an operating system continuously monitors the system. Then also,...

2 minutes read.

Non-Contiguous Memory Allocation in Operating System

Memory is nothing but a storage space where various data are stored. We can store data in temporary and permanent memory as per our future requirements for data. We can...

9 minutes read.

Round-Robin Scheduling Algorithm in OS

Round-Robin is a Preemptive Scheduling Algorithm and is the most commonly used algorithm in CPU Scheduling.In this, each Process is assigned with a fix time interval to execute, which is...

5 minutes read.

Resource Allocation Graph in Operating System

Resource Allocation Graph in OS We use the resource allocation graph for the pictographic representation of the state of a system. The resource allocation graph contains all the information related to the processes that...

5 minutes read.

Feedback Queue in Operating System

In a computer or a laptop, there is a processor which do all the tasks. The processor cannot do all the tasks at a time. So, the tasks will be...

3 minutes read.

Directory Structure in Operating System

Directory Structure in Operating System What is a Directory A Directory is the collection of the correlated files on the disk. In simple words, a directory is like a container which contains...

8 minutes read.

Booting Process in Operating System

What is Booting? Booting is defined as the term which says that the process of loading the operating system into the memory. The process of booting begins when we switch on...

4 minutes read.

Test Set Lock Mechanism | Operating System

Modification in the Assembly Code The problem in the lock variable is that, in some cases, the process reads the previous or old value of the lock variable and enters into the critical...

4 minutes read.

Simple Structure in Operating System

An operating system is a piece of software that lets the user applications talk to the hardware of the system. Because it is such a complicated structure, the operating system...

3 minutes read.

Monitors in Operating System

Monitors in Operating System Monitors are used for process synchronization. With the help of programming languages, we can use a monitor to achieve mutual exclusion among the processes. Example of monitors:...

3 minutes read.

Priority Scheduling in OS

Priority Scheduling is a type of CPU Scheduling algorithm which is used for process scheduling. In Priority Scheduling, we assign some priorities to each process. The process which has higher priority among all...

5 minutes read.

Distributed Shared Memory

Distributed Shared Memory is a process of managing memory over more than one node and makes inter-process communication which transfers to end users. It is a mechanism that allows user...

2 minutes read.

Page Table in Operating System

What is a Page Table? A page table is a data structure used by an operating system (OS) to store information about the physical location of the pages in a computer's...

6 minutes read.