Introduction
Memory management comes under the responsibility of Operating systems, and in this blog, we will learn about it. There are two types of memory allocation that the operating system handles. The first is contiguous memory allocation, and the second is non-contiguous memory allocation.
In non-contiguous memory allocation, the operating system manages a page table that includes each block's base address, acquired by the memory process.
This article will primarily discuss contiguous memory allocation, involving all the partition allocation techniques.
Let us begin the article by learning about different types of partitioning in contiguous memory allocation.
“Must Recommended Topic, Internal and External Fragmentation, Multiprogramming vs Multitasking"
Types of partitioning in contiguous memory allocation
There are two types in which the operating system can create partitions in the memory space.
Also, see Introduction to Memory and its Units
Variable size partitioning
In this policy, the operating system treats the memory as a single chunk and accordingly allocates parts of the memory as per the requirement of a different process. If possible, the leftover memory can be reused.
This policy is not recommended as the memory is allocated randomly, and thus it is very much unorganized.
The following figure shows that the operating system treats the whole memory as one unit and allocates the same amount of memory to the process, as per its requirements.
You can also read about the Multilevel Feedback Queue Scheduling and Open Source Operating System.
Fixed-size partitioning
In this policy, the operating system divides the memory into fixed-size partitions (The size of different divisions may vary). It then allocates these partitions entirely using other partition allocation techniques. Once allocated to a process, these cannot reuse the partitions in any case, and hence This will waste the memory remaining unused in the partitions internally.
The following figure shows partitions of different sizes inside the memory.
As we have discussed different types of partitions now, we will see how partition allocation techniques help the operating system allocate partitions to the process inside the memory.