Bird
Raised Fist0

If a system using the buddy system experiences frequent external fragmentation despite merging, which follow-up strategy would best address this issue without incurring high compaction overhead?

hard🎤 Interviewer Follow-up Q10 of Q15
Operating Systems - Internal vs External Fragmentation - Compaction & Buddy System
If a system using the buddy system experiences frequent external fragmentation despite merging, which follow-up strategy would best address this issue without incurring high compaction overhead?
AUse aggressive compaction after every deallocation
BImplement a hybrid allocator combining buddy system with slab allocation for small objects
CDisable merging to avoid fragmentation caused by buddy splits
DIncrease block sizes to reduce splitting and merging frequency
Step-by-Step Solution
Solution:
  1. Step 1: Identify problem cause

    Frequent external fragmentation despite merging suggests inefficiency handling small or variable-sized allocations.
  2. Step 2: Evaluate strategies

    Increasing block sizes (Increase block sizes to reduce splitting and merging frequency) worsens internal fragmentation; disabling merging (Disable merging to avoid fragmentation caused by buddy splits) increases fragmentation; aggressive compaction (Use aggressive compaction after every deallocation) is costly.
  3. Step 3: Hybrid allocator benefits

    Combining buddy system with slab allocator (Implement a hybrid allocator combining buddy system with slab allocation for small objects) handles small objects efficiently, reducing fragmentation without heavy compaction.
  4. Final Answer:

    Option B -> Option B
  5. Quick Check:

    Hybrid allocators reduce fragmentation and overhead effectively [OK]
Quick Trick: Hybrid allocators combine strengths to reduce fragmentation [OK]
Common Mistakes:
MISTAKES
  • Assuming compaction is always best
  • Ignoring hybrid approaches
Trap Explanation:
PITFALL
  • Candidates often pick costly compaction or simplistic fixes ignoring hybrid solutions.
Interviewer Note:
CONTEXT
  • Probes advanced understanding of fragmentation mitigation strategies.
Master "Internal vs External Fragmentation - Compaction & Buddy System" in Operating Systems

2 interactive learning modes - each teaches the same concept differently

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Operating Systems Quizzes