What is coalescing?

2013

What is coalescing?

Answer: D. An advantage of the buddy system is how quickly adjacent buddies can be combined to form larger segments using this technique.In dynamic memory allocation, free memory can become fragmented into many small blocks that individually cannot satisfy a larger request, even though enough…

  1. A.

    It is a second strategy for allocating kernel memory.

  2. B.

    The buddy system allocates memory from a fixed size segment consisting of physically contiguous pages.

  3. C.

    Kernel memory is often allocated from a free-memory pool different from the list used to satisfy ordinary user mode processes.

  4. D.

    An advantage of the buddy system is how quickly adjacent buddies can be combined to form larger segments using this technique.

Attempted by 711 students.

Show answer & explanation

Correct answer: D

In dynamic memory allocation, free memory can become fragmented into many small blocks that individually cannot satisfy a larger request, even though enough total free memory exists. Coalescing is the general technique of merging two or more adjacent free blocks into a single larger free block, so that fragmented free space can be reused for bigger requests without relocating or compacting other memory.

The buddy system splits memory into blocks whose sizes are powers of two. Whenever a block is freed, the allocator checks whether its buddy — the adjacent block created when the same parent block was originally split — is also free. If both buddies are free, they are merged back into the single larger block they came from, and this merging can repeat upward to form progressively bigger free blocks. This fast, repeated merging of adjacent free buddies is exactly what coalescing refers to.

For example, trace how a single request is served and then freed:

  1. Start with one free 1024 KB block. A process requests 100 KB, so the allocator repeatedly halves the block, 512 KB, then 256 KB, then 128 KB, until it reaches the smallest power-of-two size that still fits 100 KB, which is 128 KB, and allocates that block. The leftover halves of 128 KB, 256 KB, and 512 KB remain free as separate buddies.

  2. When the allocated 128 KB block is later freed, the allocator checks its buddy, the other 128 KB block created from the same split.

  3. If that buddy is also free, the two 128 KB buddies are merged back into the single 256 KB block they originally came from.

  4. The check then repeats one level up: if the new 256 KB block's buddy is also free, they merge into 512 KB, and so on, stopping as soon as a buddy is found still in use.

This repeated free-and-merge sequence is exactly what coalescing means, and it is why the buddy system can quickly rebuild large free blocks instead of leaving memory fragmented into many small, unusable pieces.

  • A statement naming a separate kernel-memory allocation scheme is talking about how memory is allocated in the first place, not about the operation of merging two already-free blocks together, so it is not a definition of coalescing.

  • A statement describing the fixed-size, physically contiguous segment that buddy memory is carved from is a fact about where buddy blocks originate, not about what happens when two free buddies are combined afterwards.

  • A statement describing a separate free-memory pool used for kernel allocations, kept apart from the pool serving ordinary user-mode processes, is about allocation-source separation, not about merging free blocks.

  • Only the description of quickly combining adjacent free buddies into a larger segment matches the merging operation that coalescing names.

Explore the full course: Up Lt Grade Assistant Teacher 2025

Loading lesson…