Discussion
In the buddy system of memory allocation, blocks are
Answer: A
Correct answer: split into halves and merged with their partner when freed
The buddy system keeps memory in blocks whose sizes are powers of two. A request is satisfied by repeatedly halving a block until the smallest adequate size is reached; the two halves produced at each split are buddies. When a block is freed, the system checks whether its buddy is also free, and if so merges the pair back into the larger block, repeating upward. Its merit is that coalescing is fast. A block’s buddy is found by flipping a single bit of its address, so merging costs almost nothing - unlike a general free-list, where finding an adjacent free block requires searching. Its cost is internal fragmentation: a request for 33 KB receives 64 KB, wasting nearly half. On average about a quarter of allocated memory is lost. It is used in the Linux kernel for physical page allocation, where the fixed page size limits the waste, and the slab allocator is layered on top of it to serve small kernel objects efficiently.
Post your comment
Please log in or register to post a comment.
Examination Categories
- SSC Exams
- Banking Exams
- Teaching Exams
- Civil Services Exams
- Railways Exams
- Engineering Recruitment Exams
- Defence Exams
- State Government Exams
- Police Exams
- Insurance Exams
- Nursing Exams
- Other Government Exams
- NRA CET
- PG Entrance Exams
- Campus Placement
- MBA Entrance Exams
- CUET and UG Entrance
- Judiciary Exams
- Regulatory Body Exams
- Software Development