Question
Consider six memory partitions of sizes 200 KB, 400 KB, 600 KB, 500 KB, 300 KB and 250 KB, where KB refers to kilobyte. These partitions need to be allotted to four processes of sizes 357 KB, 210 KB, 468 KB and 491 KB in that order. If the best fit algorithm is used, which partitions are NOT allotted to any process?
Official answer and solution
- Official answer
- A
- From
- Official GATE 2015 answer key
Solution
Trace the Best Fit dynamic memory allocation policy for the sequential process requests.
Initial available partitions:
The Best Fit algorithm allocates the smallest available partition that is large enough () for each process:
- Process 1 (357 KB):
Partitions KB are .
The smallest is 400 KB. 400 KB is allocated to Process 1.
Remaining partitions: .
- Process 2 (210 KB):
Partitions KB are .
The smallest is 250 KB. 250 KB is allocated to Process 2.
Remaining partitions: .
- Process 3 (468 KB):
Partitions KB are .
The smallest is 500 KB. 500 KB is allocated to Process 3.
Remaining partitions: .
- Process 4 (491 KB):
Partitions KB is only .
600 KB is allocated to Process 4.
Remaining partitions: .
The partitions that are NOT allotted to any process are 200 KB and 300 KB (option A).
A
Applying First Fit instead of Best Fit, which would allocate 600 KB to Process 1.
The answer is the one in the official GATE answer key. The solution is this site's own explanation.
Source
- Paper
- GATE 2015 Computer Science and Information Technology (CS) Session 2
- Question
- 40 of 65, printed as CS Q.30
- 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.