Prerequisite – Partition Allocation Methods
Static partition schemes suffer from the limitation of having the fixed number of active processes and the usage of space may also not be optimal. The buddy system is a memory allocation and management algorithm that manages memory in power of two increments. Assume the memory size is 2U, suppose a size of S is required.
- If 2U-1<S<=2U: Allocate the whole block
- Else: Recursively divide the block equally and test the condition at each time, when it satisfies, allocate the block and get out the loop.
System also keep the record of all the unallocated blocks each and can merge these different size blocks to make one big chunk.
Advantage –
- Easy to implement a buddy system
- Allocates block of correct size
- It is easy to merge adjacent holes
- Fast to allocate memory and de-allocating memory
Disadvantage –
- It requires all allocation unit to be powers of two
- It leads to internal fragmentation
Example –
Consider a system having buddy system with physical address space 128 KB.Calculate the size of partition for 18 KB process.
Solution –

So, size of partition for 18 KB process = 32 KB. It divides by 2, till possible to get minimum block to fit 18 KB.
Attention reader! Don’t stop learning now. Get hold of all the important CS Theory concepts for SDE interviews with the CS Theory Course at a student-friendly price and become industry ready.
Recommended Posts:
- Buddy Memory Allocation Program | Set 1 (Allocation)
- Buddy Memory Allocation Program | Set 2 (Deallocation)
- Allocating kernel memory (buddy system and slab system)
- Difference between Static allocation and Stack allocation
- Difference between Static Allocation and Heap Allocation
- MCQ on Memory allocation and compilation process
- Difference between Contiguous and Noncontiguous Memory Allocation
- Implementation of all Partition Allocation Methods in Memory Management
- Partition Allocation Methods in Memory Management
- Resource Allocation Graph (RAG) in Operating System
- Allocation of frames in Operating System
- Non-Contiguous Allocation in Operating System
- Best-Fit Allocation in Operating System
- Difference between Volatile Memory and Non-Volatile Memory
- Random Access Memory (RAM) and Read Only Memory (ROM)
- Introduction to memory and memory units
- Difference between Byte Addressable Memory and Word Addressable Memory
- Difference between Virtual memory and Cache memory
- IPC technique PIPES
- Virtual Memory in Operating System
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.

