Consider allocation of memory to a new process. Assume that none of the existing holes in the memory will exactly fit the process’s memory requirement. Hence, a new hole of smaller size will be created if allocation is made in any of the existing holes. Which one of the following statement is TRUE?
View worked solution
Answer: C
Let the memory requirement of the new process be . Suppose the available holes in the memory that are large enough to accommodate the process are represented by the set , where each .
When a process of size is allocated to a hole of size , the size of the newly created remaining hole is given by .
Analyzing the Options:
-
Best Fit Strategy: By definition, the Best Fit algorithm searches the entire list of holes and allocates the process to the smallest hole that is large enough.
Let be the hole selected by Best Fit. Then: -
First Fit Strategy: First Fit allocates the process to the first hole that it encounters. Since is the absolute minimum among all valid holes in , we must have:
Subtracting from both sides:
This means the remaining hole created by Best Fit is always less than or equal to (i.e., never larger than) the remaining hole created by First Fit.
Hence, Option C is TRUE.
Why other options are incorrect:
- Option A & B: If there is only one hole available in the system that can accommodate the process, all strategies (First Fit, Next Fit, Best Fit, Worst Fit) will choose this same hole. The resulting new hole size will be identical for all of them. Thus, the hole created by First Fit or Worst Fit is not always larger than others.
- Option D: Since Best Fit always produces the smallest possible leftover hole, any other strategy (including Next Fit) will produce a leftover hole that is greater than or equal to that of Best Fit. Thus, Next Fit is never smaller (i.e., it is often larger) than Best Fit.
Free practice · Your answers on this page are not saved.
