When is worst fit in memory allocation useful

Austin Davis picture Austin Davis · Mar 27, 2013 · Viewed 13.7k times · Source

I'm reading operating system concepts essisentals 8th edition. When the author goes over contiguous memory allocation and worst fit the author states "Allocate the largest hole. Again, we must search the entire list unless it is sorted by size. This strategy produces the largest leftover hole, which may be more useful than the smaller leftover hole from a best-fit approach."

So my question, when is leaving the biggiest leftover hole a better approach?

Answer

peter picture peter · Jun 9, 2013

Leaving the biggest leftover hole could be a better approach if all the processes submitted tend to be around the same size.

In that case, if you have a large free block (say 50MB) and most of the processes submitted tend to be smaller than that (say 10MB), it would actually be better to put them in this big block so that you can use the leftover space better, rather than put them in a barely bigger block (maybe 11-15MB) which would leave some small unusable space.

I don't know if it's actually used anywhere though.

Have a read (and a play) of this: http://research.cs.vt.edu/AVresearch/MMtutorial/WorstFit.php