Memory Allocation
First / Best / Worst fit on a fixed set of partitions.
Memory layout (100 KB pool)
J1
J2
free
J5
J1 12KJ4 4Kfree 4KJ2 10KJ3 9Kfree 9Kfree 6Kfree 14KJ5 20Kfree 2Kfree 8K
Used
55 KB
Rejected jobs
1
Allocation trace
J1 (12 KB)placed 0–12
J2 (10 KB)placed 20–30
J3 (9 KB)placed 30–39
J4 (4 KB)placed 12–16
J5 (20 KB)placed 68–88
J6 (17 KB)no partition fits
Compare the strategies: First fit is fastest, Best fit minimizes leftover fragments but leaves tiny holes, Worst fit keeps large holes available for future big jobs but wastes the most space on small ones.