Table of contents
1.
Introduction
2.
What is Fixed Partitioning?
2.1.
How does fixed partitioning work?
2.2.
Advantages
2.3.
Disadvantages
3.
Frequently Asked Questions
3.1.
What is multiprogramming with a fixed partition?
3.2.
What is the drawback of fixed partition multiprogramming?
3.3.
What are the Advantages & Disadvantages of Fixed Partitions?
4.
Conclusion
Last Updated: Mar 27, 2024

Fixed Size Partitioning

Career growth poll
Do you think IIT Guwahati certified course can help you in your career?
Operating Systems

Introduction

The operating system manages a computer’s memory through memory management. To ensure that primary memory is utilized effectively, the memory management feature keeps track of the position of each memory location, either allocated or free. There is a technique called contiguous memory management technique, which is divided into two types:

  1. Fixed-size Partitioning
  2. Variable size Partitioning

What is Fixed Partitioning?

In contiguous memory allocation, one of the ways we allocate memory to the processes as they come into RAM is by using fixed-size partitioning, also known as static partitioning.

The idea behind fixed partitioning is that memory is divided into fixed-size partitions. 

This is done by putting the operating system in the lowest memory location. 

When processes enter the system, they are classified based on how much memory they require. Each class of process requires a Process Queue.

Once a process is selected to allocate memory, it is loaded into memory and competes for the processor.

The number of fixed partitions measures Multi-programming. Each queue has its memory region, so there is no competition for memory between them.

Whenever we start our system, the operating system gets loaded in the RAM, and then the remaining memory is used for allocating the processes to the CPU.

RAM

 

In the above diagram, the left side has the fixed partitioning of different sizes, and the right side has the fixed partitioning of equal sizes, i.e., 4MB.

Note: The process we will allocate should be less than or equal to the memory size. Because if we allocate the process greater than the fixed size, it will create internal fragmentation.

Must Recommended Topic, Internal and External Fragmentation, Multiprogramming vs Multitasking

How does fixed partitioning work?

Case1: Suppose a process P1 comes of size 2MB. We allocated it at position 0. Note that we can allocate it at any place. Still, its size should be less than the fixed partition in contiguous memory allocation; we cannot divide one process into different processes. So in this way, there will be no internal fragmentation(2MB-2MB=0MB).

 

Paritioning

 

 

Case 2: Suppose a process P2 comes of size 3MB. First, we will check where the space is available. If there is no process yet allocated in the memory, we allocate it to position 1; if not, wherever the space is available, we will allocate it there. So at position one, the available memory is 4MB, and the process is 3MB. Hence there will be an internal fragmentation(4MB-3MB=1MB).

Paritioning

 

Case 3: Suppose a process P3 comes of size 12MB.We can not allocate this process in the memory as it is larger than the fixed partitions. So there will be a limited process quantity.

Advantages

  1. Easy to implement:
    Implementing a division or partition is not a difficult task. Whether internal or external fragmentation occurs, it must process the specific partitions.
  2. Little OS overhead:
    Fixed partitions require a relatively low amount of computing power.

Disadvantages

  1. Internal Fragmentation:
    Inefficient use of main memory. No matter how small the program, it occupies the entire partition. This increases the chances of internal fragmentation.
  2. Limited process size:
    Typically, the main memory cannot accommodate larger processes than their partition size. It is impossible to resize the partition according to the size of incoming processes.
  3. Degree of multiprogramming:
    The main memory is partitioned either before or during the system configuration process. A fixed number of partitions are set up in the main memory. The condition R<= P must be met if R partitions in RAM and P is the number of processes. There is an error if the number of processes in a particular partition exceeds the number of RAM partitions.
  4. External fragmentation:
    Due to the limitations of spanning, the total unused space on different partitions cannot be used to load non-differentiated processes, even if the space is available.


You can also read about the interleave memory and Open Source Operating System.

Frequently Asked Questions

What is multiprogramming with a fixed partition?

If we decide that multiprogramming is a good idea, we must next decide how to organize the available memory. This is to get the maximum possible use of that resource.

An excellent way to do this is to divide the memory into fixed-size partitions. Partitions of different sizes can exist, but it stays that size once a partition takes on a specific size, and as we know that these partitions cannot be resized. 

What is the drawback of fixed partition multiprogramming?

This partitioning has a few disadvantages:

  • Partition sizes are fixed, so unused space is lost for each process.
  • There may be no easy way to determine how big the partition a given process requires.
  • The process may not run if placed in the queue because other processes may use that part of the partition.

What are the Advantages & Disadvantages of Fixed Partitions?

Advantages:

  • A fixed partition has the advantage of preventing data loss during power outages or when the software fails.
    • A fixed partition also has the advantage of allowing you to install more than one operating system. You can have both Windows 10 and Linux installed on the same hard drive. 
      Disadvantages:
  • A partition restriction prevents the installation of files, folders, and programs bigger than the partition. As a result, you can only operate or work on a specific partition.
  • The second disadvantage of fixed partitions is the reduction of disk space when running different operating systems on the same hard drive. 

Conclusion

This article is about Static partitioning, also known as a fixed-size partitioning scheme. In this technique, the main memory is pre-divided into fixed-size partitions. The size of each partition is fixed and can not be changed. Each partition is allowed to store only one process.

Recommended Reading:

Do check out The Interview guide for Product Based Companies as well as some of the Popular Interview Problems from Top companies like Amazon, Adobe, Google, Uber, Microsoft, etc. on Coding Ninjas Studio.

Also check out some of the Guided Paths on topics such as Data Structure and Algorithms, Competitive Programming, Operating Systems, Computer Networks, DBMS, System Design, etc. as well as some Contests, Test Series, Interview Bundles, and some Interview Experiences curated by top Industry Experts only on Coding Ninjas Studio.

Cheers!

Live masterclass