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?

Choose one option
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 PP be the memory requirement of the new process. When allocating memory from an existing hole of size H>PH > P, the size of the remaining smaller hole created is H−PH - P.

Definitions of the placement strategies:

  • Best Fit selects the smallest hole that is large enough: Hbest=min⁡{Hi∣Hi>P}H_{\text{best}} = \min \{H_i \mid H_i > P\}.
  • First Fit selects the first hole encountered in memory that satisfies Hfirst>PH_{\text{first}} > P.

Comparison:

  • By definition of the minimum, Hbest≤HH_{\text{best}} \le H for every candidate hole HH that fits the process. Specifically, Hbest≤HfirstH_{\text{best}} \le H_{\text{first}}.
  • Subtracting PP from both sides: Hbest−P≤Hfirst−PH_{\text{best}} - P \le H_{\text{first}} - P.
  • Therefore, the hole left behind by best fit is never larger than the hole left behind by first fit.
Final answer

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.