Skip to content
Official PYQ · 2015

GATE CS 2015 Set 2 Q30 — Memory Management and Virtual Memory

Explain with AI

Consider 66 memory partitions of sizes 200200 KB\text{KB}, 400400 KB\text{KB}, 600600 KB\text{KB}, 500500 KB\text{KB}, 300300 KB\text{KB} and 250250 KB\text{KB}, where KB\text{KB}refers to kilobyte\text{kilobyte}. These partitions need to be allotted to four processes of sizes 357357 KB\text{KB}, 210210 KB\text{KB}, 468468 KB\text{KB}, 491491 KB\text{KB} in that order. If the best-fit algorithm is used, which partitions are NOT allotted to any process?

Choose one option
View worked solution

Answer: A

The Best-Fit memory allocation policy assigns a process to the smallest available memory partition that is large enough to accommodate it. This minimizes the leftover wasted space (internal fragmentation) in the allocated partition.

Let the initial set of available partition sizes be:

{200 KB,400 KB,600 KB,500 KB,300 KB,250 KB}\{200\text{ KB}, 400\text{ KB}, 600\text{ KB}, 500\text{ KB}, 300\text{ KB}, 250\text{ KB}\}

We allocate the processes of sizes 357 KB357\text{ KB}, 210 KB210\text{ KB}, 468 KB468\text{ KB}, and 491 KB491\text{ KB} sequentially:

  1. Process 1 (357 KB357\text{ KB}):
    • Partitions large enough: 400 KB400\text{ KB}, 500 KB500\text{ KB}, 600 KB600\text{ KB}.
    • The smallest among these is 400 KB400\text{ KB}.
    • Allocation: 400 KB400\text{ KB} partition is allocated.
  2. Process 2 (210 KB210\text{ KB}):
    • Partitions large enough: 250 KB250\text{ KB}, 300 KB300\text{ KB}, 500 KB500\text{ KB}, 600 KB600\text{ KB}.
    • The smallest among these is 250 KB250\text{ KB}.
    • Allocation: 250 KB250\text{ KB} partition is allocated.
  3. Process 3 (468 KB468\text{ KB}):
    • Partitions large enough: 500 KB500\text{ KB}, 600 KB600\text{ KB}.
    • The smallest among these is 500 KB500\text{ KB}.
    • Allocation: 500 KB500\text{ KB} partition is allocated.
  4. Process 4 (491 KB491\text{ KB}):
    • Partitions large enough: 600 KB600\text{ KB}.
    • Allocation: 600 KB600\text{ KB} partition is allocated.

After allocating all four processes, the partitions that remain unallocated are:

200 KBand300 KB\mathbf{200\text{ KB}} \quad \text{and} \quad \mathbf{300\text{ KB}}

Thus, the correct option is A.

Free practice · Your answers on this page are not saved.

Published
Report a correction
Keep exploringMore Memory Management and Virtual Memory questions