Bird
Raised Fist0

You are designing a memory allocator for an embedded system with limited CPU and memory resources. Which approach is preferable to minimize fragmentation and why?

hard🌍 Real-world Scenario Q9 of Q15
Operating Systems - Internal vs External Fragmentation - Compaction & Buddy System
You are designing a memory allocator for an embedded system with limited CPU and memory resources. Which approach is preferable to minimize fragmentation and why?
AUse memory compaction frequently to avoid all fragmentation types
BUse fixed partitioning to eliminate external fragmentation completely
CUse the buddy system to balance internal and external fragmentation with simple merging
DUse a slab allocator to minimize internal fragmentation for fixed-size objects
Step-by-Step Solution
Solution:
  1. Step 1: Consider embedded system constraints

    Limited CPU and memory require efficient, low-overhead allocation.
  2. Step 2: Evaluate options

    Fixed partitioning wastes memory due to inflexibility; frequent compaction is CPU-intensive; slab allocator suits fixed-size objects but not general allocation.
  3. Step 3: Buddy system advantages

    Buddy system offers a good tradeoff with dynamic splitting/merging and moderate fragmentation control.
  4. Final Answer:

    Option C -> Option C
  5. Quick Check:

    Buddy system balances fragmentation and overhead well for embedded systems [OK]
Quick Trick: Buddy system balances fragmentation and overhead in constrained systems [OK]
Common Mistakes:
MISTAKES
  • Choosing compaction despite CPU cost
  • Assuming fixed partitioning eliminates all fragmentation
Trap Explanation:
PITFALL
  • Candidates may overlook overhead tradeoffs and pick theoretically perfect but impractical solutions.
Interviewer Note:
CONTEXT
  • Tests practical design tradeoffs in constrained environments.
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