| Algorithm | Time Complexity | Final EF % | Free Blocks | Alloc Success | Failures | Rank |
|---|---|---|---|---|---|---|
| Run simulation to see results | ||||||
Silberschatz, Galvin & Gagne (OS Concepts, 10th ed.):
Best Fit minimises wasted space per allocation but creates many tiny leftover fragments too small for any future request. This causes higher long-term external fragmentation despite optimal per-allocation decisions. A classic example of a locally-optimal greedy strategy failing globally — a key OS exam insight.
Each block stores: start, size, free, pid, prev*, next*
Linux uses the buddy system + slab allocator. glibc malloc() uses a variant of First Fit with size-class bins. The key insight: speed (O(1) amortised) matters more than minimal fragmentation in a real kernel. This simulator proves why the theoretical "best" algorithm — Best Fit — is almost never used in production operating systems.