When is "worst fit in memory allocation" useful?
Asked Answered
W

1

10

I'm reading Operating System Concepts Essentials 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 biggest leftover hole a better approach?

Wake answered 27/3, 2013 at 0:39 Comment(2)
Your main question asks when worst fit is useful, but then you say your question is when leaving a smaller hole is better, which is not what worst fit does.Percy
thanks for catching thatWake
S
10

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

Sandal answered 9/6, 2013 at 7:21 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.