Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

When is worst fit in memory allocation useful

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?

like image 916
Austin Davis Avatar asked Mar 27 '13 00:03

Austin Davis


1 Answers

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

like image 162
peter Avatar answered Oct 31 '22 03:10

peter