The Gateway to Computer Science Excellence
0 votes

There are 5 processes in a job queue

Process Memory Required Time
P1 600kb 10 ms
P2 1000kb 5 ms
P3 300kb 20 ms
P4 700kb  8 ms
P5 500kb 15 ms

Memory is byte addressable

If the size of the memory is 2000 kb and contiguous memory allocation is used, then after 30 ms, which processes will be in memory?

(A) P4,P5 only

(B) P1, P2 only

(C) P3, P4 only

(D) None of these

in Algorithms by Active (2.5k points) | 1k views

1 Answer

+3 votes
Best answer

Answer will be D) None of these

Time 0 Ms : Schedule P1, P2, P3 (Memory still you have 100 KB)

Time 5 Ms : P2 Get completed then you will have memory (1100 KB), Now you can schedule P4, (memory still you have is 400 KB)

Time 10 Ms: P1 get completed the you will have memory (1000 KB), Now you can schedule P5.

Time 13 Ms: P4 will get completed.

Time 20 Ms: P3 will get completed.

Time 25Ms: P5 will get completed.

Time 30Ms: No processor is in the memory.

by Boss (35.7k points)
selected by
how did you conclude that P2 will execute first??
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
50,737 questions
57,373 answers
105,286 users