Buddy System

Replacement algorithm that fixes both fixed and dynamic partitioning schemes drawbacks. In fact, a fixed partitioning scheme limits the number of active processes and may use space inefficiently if there is a poor match between available partition sizes and process sizes. A dynamic partition- ing scheme is more complex to maintain and includes the overhead of compaction. An interesting compromise is the buddy system.

Example:

Binary Tree representation of the buddy allocation immediately after the Release B request. The leaf nodes represent the current partitioning of the memory. If two buddies are leaf nodes, then at least one must be allocated; otherwise they would be coalesced into a larger block.