Partition Selection Algorithms – 10M
Problem: Given memory partitions: 150K, 500K, 200K, 300K, 550K (in order)
Processes: 220K, 430K, 110K, 425K (in order)
1. First Fit
Allocate each process to the first available partition that is large enough.
Process Allocation (First Fit) Partition Left
220K 500K Leftover 280K
430K 550K Leftover 120K
110K 150K Leftover 40K
425K Cannot fit Must wait
2. Best Fit
Allocate each process to the smallest partition that is large enough.
Process Allocation (Best Fit) Partition Left
220K 300K Leftover 80K
430K 500K Leftover 70K
110K 150K Leftover 40K
425K 550K Leftover 125K
3. Worst Fit
Allocate each process to the largest available partition.
Process Allocation (Worst Partition Left
Fit)
220K 550K Leftover 330K
430K 500K Leftover 70K
110K 330K Leftover 220K
425K Cannot fit Must wait
Conclusion
Best Fit makes the most efficient use of memory here, because all four processes are
allocated successfully.
Best-fit turns out to be the best
Problem: Given memory partitions: 150K, 500K, 200K, 300K, 550K (in order)
Processes: 220K, 430K, 110K, 425K (in order)
1. First Fit
Allocate each process to the first available partition that is large enough.
Process Allocation (First Fit) Partition Left
220K 500K Leftover 280K
430K 550K Leftover 120K
110K 150K Leftover 40K
425K Cannot fit Must wait
2. Best Fit
Allocate each process to the smallest partition that is large enough.
Process Allocation (Best Fit) Partition Left
220K 300K Leftover 80K
430K 500K Leftover 70K
110K 150K Leftover 40K
425K 550K Leftover 125K
3. Worst Fit
Allocate each process to the largest available partition.
Process Allocation (Worst Partition Left
Fit)
220K 550K Leftover 330K
430K 500K Leftover 70K
110K 330K Leftover 220K
425K Cannot fit Must wait
Conclusion
Best Fit makes the most efficient use of memory here, because all four processes are
allocated successfully.
Best-fit turns out to be the best