Skip to content
Related Articles
Get the best out of our app
Open App

Related Articles

Variable (or dynamic) Partitioning in Operating System

Improve Article
Save Article
Like Article
Improve Article
Save Article
Like Article

In operating systems, Memory Management is the function responsible for allocating and managing computer’s main memory. Memory Management function keeps track of the status of each memory location, either allocated or free to ensure effective and efficient use of Primary Memory. There are two Memory Management Techniques: Contiguous, and Non-Contiguous. In Contiguous Technique, executing process must be loaded entirely in main-memory. Contiguous Technique can be divided into:

  1. Fixed (or static) partitioning
  2. Variable (or dynamic) partitioning

Variable Partitioning – It is a part of Contiguous allocation technique. It is used to alleviate the problem faced by Fixed Partitioning. In contrast with fixed partitioning, partitions are not made before the execution or during system configure. Various features associated with variable Partitioning-

  1. Initially RAM is empty and partitions are made during the run-time according to process’s need instead of partitioning during system configure.
  2. The size of partition will be equal to incoming process.
  3. The partition size varies according to the need of the process so that the internal fragmentation can be avoided to ensure efficient utilisation of RAM.
  4. Number of partitions in RAM is not fixed and depends on the number of incoming process and Main Memory’s size.

There are some advantages and disadvantages of variable partitioning over fixed partitioning as given below. Advantages of Variable Partitioning –

  1. No Internal Fragmentation: In variable Partitioning, space in main memory is allocated strictly according to the need of process, hence there is no case of internal fragmentation. There will be no unused space left in the partition.
  2. No restriction on Degree of Multiprogramming: More number of processes can be accommodated due to absence of internal fragmentation. A process can be loaded until the memory is empty.
  3. No Limitation on the size of the process: In Fixed partitioning, the process with the size greater than the size of the largest partition could not be loaded and process can not be divided as it is invalid in contiguous allocation technique. Here, In variable partitioning, the process size can’t be restricted since the partition size is decided according to the process size.

Disadvantages of Variable Partitioning –

  1. Difficult Implementation: Implementing variable Partitioning is difficult as compared to Fixed Partitioning as it involves allocation of memory during run-time rather than during system configure.
  2. External Fragmentation: There will be external fragmentation inspite of absence of internal fragmentation. For example, suppose in above example- process P1(2MB) and process P3(1MB) completed their execution. Hence two spaces are left i.e. 2MB and 1MB. Let’s suppose process P5 of size 3MB comes. The empty space in memory cannot be allocated as no spanning is allowed in contiguous allocation. The rule says that process must be contiguously present in main memory to get executed. Hence it results in External Fragmentation. Now P5 of size 3 MB cannot be accommodated in spite of required available space because in contiguous no spanning is allowed.

Here are some important points about variable (or dynamic) partitioning in operating systems and some reference books you may find helpful:

  1. Variable (or dynamic) partitioning is a memory allocation technique that allows memory partitions to be created and resized dynamically as needed.
  2. The operating system maintains a table of free memory blocks or holes, each of which represents a potential partition. When a process requests memory, the operating system searches the table for a suitable hole that can accommodate the requested amount of memory.
  3. Dynamic partitioning reduces internal fragmentation by allocating memory more efficiently, allows multiple processes to share the same memory space, and is flexible in accommodating processes with varying memory requirements.
  4. However, dynamic partitioning can also lead to external fragmentation and requires more complex memory management algorithms, which can make it slower than fixed partitioning.
  5. Understanding dynamic partitioning is essential for operating system design and implementation, as well as for system-level programming.

Here are some reference books on operating system concepts that cover memory management:

  1. “Operating System Concepts” by Abraham Silberschatz, Peter Baer Galvin, and Greg Gagne.
  2. “Modern Operating Systems” by Andrew S. Tanenbaum.
  3. “Operating Systems: Three Easy Pieces” by Remzi H. Arpaci-Dusseau and Andrea C. Arpaci-Dusseau.
  4. “Linux Kernel Development” by Robert Love.
  5. “Windows Internals” by Mark Russinovich and David Solomon.
    These books provide in-depth coverage of operating system concepts and are widely regarded as standard references in the field.
My Personal Notes arrow_drop_up
Last Updated : 13 Apr, 2023
Like Article
Save Article
Similar Reads