Question
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 statements is TRUE?
Official answer and solution
- Official answer
- C
- From
- Official GATE 2020 answer key
Solution
Compare the definition of Best Fit with First Fit to analyze the size of the residual hole created.
Let be the memory requirement of the new process. When allocating memory from an existing hole of size , the size of the remaining smaller hole created is .
Definitions of the placement strategies:
- Best Fit selects the smallest hole that is large enough: .
- First Fit selects the first hole encountered in memory that satisfies .
Comparison:
- By definition of the minimum, for every candidate hole that fits the process. Specifically, .
- Subtracting from both sides: .
- Therefore, the hole left behind by best fit is never larger than the hole left behind by first fit.
C
The answer is the one in the official GATE answer key. The solution is this site's own explanation.
Source
- Paper
- GATE 2020 Computer Science and Information Technology (CS)
- Question
- 21 of 65, printed as CS Q.11
- Section
- Computer Science and Information Technology
Report an error in this question
GATE questions are the work of the organising institutes. This site is independent and is not affiliated with them.