Skip to content
Official PYQ · 1998

GATE CS 1998 Q2.16 — Memory Management and Virtual Memory

Explain with AI

The overlay tree for a program is as shown below:

What will be the size of the partition (in physical memory) required to load (and run) this program?

Choose one option
View worked solution

Answer: B

In an overlay structure, only the modules lying on a single active path from the root to a leaf need to reside in the physical memory simultaneously. Therefore, the minimum size of the physical memory partition required is the maximum sum of module sizes along any root-to-leaf path.

The overlay tree consists of the following paths and their respective memory requirements:

  • Path 1: Root (2 KB)→A (4 KB)→C (6 KB)  ⟹  2+4+6=12 KB\text{Root (2 KB)} \rightarrow \text{A (4 KB)} \rightarrow \text{C (6 KB)} \implies 2 + 4 + 6 = 12\text{ KB}
  • Path 2: Root (2 KB)→A (4 KB)→D (8 KB)  ⟹  2+4+8=14 KB\text{Root (2 KB)} \rightarrow \text{A (4 KB)} \rightarrow \text{D (8 KB)} \implies 2 + 4 + 8 = 14\text{ KB}
  • Path 3: Root (2 KB)→B (6 KB)→E (2 KB)  ⟹  2+6+2=10 KB\text{Root (2 KB)} \rightarrow \text{B (6 KB)} \rightarrow \text{E (2 KB)} \implies 2 + 6 + 2 = 10\text{ KB}
  • Path 4: Root (2 KB)→B (6 KB)→F (4 KB)  ⟹  2+6+4=12 KB\text{Root (2 KB)} \rightarrow \text{B (6 KB)} \rightarrow \text{F (4 KB)} \implies 2 + 6 + 4 = 12\text{ KB}

The maximum memory required by any path is max⁡(12,14,10,12)=14 KB\max(12, 14, 10, 12) = 14\text{ KB}. Thus, a partition of size 14 KB is required to run this program.

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

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