AlgoPlus//structures / memory-allocation
Read the theory

Allocation & Fragmentation

Contiguous memory fragments over time — the fit strategy shapes how badly.

Strategy
First fit
Free total
0
Largest hole
0
Strategy
Request sizes (allocations, 1–100)
Legend
Allocated block
Free hole
Can't fit (frag.)
AI Tutor Workspace
In a nutshell
Contiguous allocation gives each process one unbroken block of memory, so the OS must find a free gap — a hole — large enough to hold it. First fit takes the first hole that works, best fit the smallest that works, worst fit the largest. Over time free space scatters into gaps too small to use (external fragmentation), even when the total free space would be plenty; compaction slides blocks together to fix it.
Ready
Press play to begin the cinematic walkthrough.
Contiguous allocation needs one unbroken hole per process. First/Best/Worst fit pick that hole differently, but all eventually scatter free space into pieces too small to use — external fragmentation — even when the total free space would be plenty.
Key terms
Go deeper in the lesson
Read the full theory, intuition & complexity for Allocation & Fragmentation.