The Gateway to Computer Science Excellence
First time here? Checkout the FAQ!
+15 votes

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?

  1. $\text{12 KB}$
  2. $\text{14 KB}$
  3. $\text{10 KB}$
  4. $\text{8 KB}$
asked in Operating System by Veteran (59.6k points)
edited by | 2k views

3 Answers

+25 votes
Best answer

"To enable a process to be larger than the amount of memory allocated to it, we can use overlays. The idea of overlays is to keep in memory only those instructions and data that are needed at any given time. When other instructions are needed, they are loaded into space occupied previously by instructions that are no longer needed." For the above program, maximum memory will be required when running code portion present at leaves. Max requirement $=$ (max of requirements of $D,E,F$, and $G$. $=MAX( 12,14,10,14) =14$ (Answer)

answered by Active (1.5k points)
edited by
+5 votes
traverse this as depth first left to right. when we visit a node for first time, it is loaded in main memory and when we visit it for last time, it is pulled out. so max size will be needed when we pull out D and load E in the main memory which is 14 KB.
answered by Junior (527 points)
+5 votes
DF travelling the tree, we find Root->A->E & Root->C->G have the maximum weights (2+4+8=14) & (2+8+4=14) respectively.

Ans :B
answered by Active (2.1k points)

Hi @Pronomita Dey 1 ji,

Could you please add some reference to support your answer. I will be great help. 

Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true

40,855 questions
47,520 answers
62,278 users