The Wayback Machine - https://web.archive.org/web/20230419123153/https://www.geeksforgeeks.org/fixed-or-static-partitioning-in-operating-system/
Skip to content
Related Articles
Get the best out of our app
GFG App
Open App
geeksforgeeks
Browser
Continue

Related Articles

Fixed (or static) Partitioning in Operating System

Improve Article
Save Article
Like Article
author
Vidhayak_Chacha
proficient
10 published articles
Improve Article
Save Article
Like Article

Fixed partitioning, also known as static partitioning, is a memory allocation technique used in operating systems to divide the physical memory into fixed-size partitions or regions, each assigned to a specific process or user. Each partition is typically allocated at system boot time and remains dedicated to a specific process until it terminates or releases the partition.

  1. In fixed partitioning, the memory is divided into fixed-size chunks, with each chunk being reserved for a specific process. When a process requests memory, the operating system assigns it to the appropriate partition. Each partition is of the same size, and the memory allocation is done at system boot time.
  2. Fixed partitioning has several advantages over other memory allocation techniques. First, it is simple and easy to implement. Second, it is predictable, meaning the operating system can ensure a minimum amount of memory for each process. Third, it can prevent processes from interfering with each other’s memory space, improving the security and stability of the system.
  3. However, fixed partitioning also has some disadvantages. It can lead to internal fragmentation, where memory in a partition remains unused. This can happen when the process’s memory requirements are smaller than the partition size, leaving some memory unused. Additionally, fixed partitioning limits the number of processes that can run concurrently, as each process requires a dedicated partition.

Overall, fixed partitioning is a useful memory allocation technique in situations where the number of processes is fixed, and the memory requirements for each process are known in advance. It is commonly used in embedded systems, real-time systems, and systems with limited memory resources.

In operating systems, Memory Management is the function responsible for allocating and managing a 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 the main memory. Contiguous Technique can be divided into: 

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

Fixed Partitioning: 
This is the oldest and simplest technique used to put more than one process in the main memory. In this partitioning, the number of partitions (non-overlapping) in RAM is fixed but the size of each partition may or may not be the same. As it is a contiguous allocation, hence no spanning is allowed. Here partitions are made before execution or during system configure. 

 

As illustrated in above figure, first process is only consuming 1MB out of 4MB in the main memory. 
Hence, Internal Fragmentation in first block is (4-1) = 3MB. 
Sum of Internal Fragmentation in every block = (4-1)+(8-7)+(8-7)+(16-14)= 3+1+1+2 = 7MB. 

Suppose process P5 of size 7MB comes. But this process cannot be accommodated in spite of available free space because of contiguous allocation (as spanning is not allowed). Hence, 7MB becomes part of External Fragmentation. 

There are some advantages and disadvantages of fixed partitioning. 

Advantages of Fixed Partitioning –  

  1. Easy to implement: 
    Algorithms needed to implement Fixed Partitioning are easy to implement. It simply requires putting a process into a certain partition without focusing on the emergence of Internal and External Fragmentation. 
     
  2. Little OS overhead: 
    Processing of Fixed Partitioning requires lesser excess and indirect computational power.
  3. Predictable and can ensure a minimum amount of memory for each process.
  4. Can prevent processes from interfering with each other’s memory space.
  5. Suitable for systems with a fixed number of processes and known memory requirements. 
     

Disadvantages of Fixed Partitioning – 

  1. Internal Fragmentation: 
    Main memory use is inefficient. Any program, no matter how small, occupies an entire partition. This can cause internal fragmentation. 
     
  2. External Fragmentation: 
    The total unused space (as stated above) of various partitions cannot be used to load the processes even though there is space available but not in the contiguous form (as spanning is not allowed). 
     
  3. Limit process size: 
    Process of size greater than the size of the partition in Main Memory cannot be accommodated. The partition size cannot be varied according to the size of the incoming process size. Hence, the process size of 32MB in the above-stated example is invalid. 
     
  4. Limitation on Degree of Multiprogramming: 
    Partitions in Main Memory are made before execution or during system configure. Main Memory is divided into a fixed number of partitions. Suppose if there are n1     partitions in RAM and n2     are the number of processes, then n2 <= n1     condition must be fulfilled. Number of processes greater than the number of partitions in RAM is invalid in Fixed Partitioning. 
     
  5. Limits the number of processes that can run concurrently.
  6. Inefficient use of memory if the process’s memory requirements are smaller than the partition size.
  7. Not suitable for systems with a large number of processes with varying memory requirements.
  8. Difficult to optimize memory usage, as partitions cannot be resized dynamically.
  9. Here are some important points about memory allocation techniques and some reference books you may find helpful:
  10. Memory allocation is the process of assigning physical memory to a process or program in a computer system.
  11. The main memory allocation techniques are fixed partitioning, dynamic partitioning, buddy system, and slab allocation.
  12. Fixed partitioning divides memory into fixed-size partitions, with each partition dedicated to a specific process. Dynamic partitioning, on the other hand, allows memory to be allocated and deallocated dynamically as needed.
  13. The buddy system is a memory allocation technique that allocates memory in power-of-two sizes, while slab allocation is a technique that pools memory of similar sizes.
  14. The choice of memory allocation technique depends on the specific requirements of the system, such as the number of processes, the size of memory, and the need for dynamic allocation.
    Understanding memory allocation techniques 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.
  6. 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
Related Articles