A computer has 1000K of main memory. The jobs arrive and finish in the following sequence. Job 1 requiring 200 K arrives Job 2 requiring 350 K arrives Job 3 requiring 300 K arrives Job 1 finishes Job 4 requiring 120 K arrives Job 5 requiring 150 K arrives Job 6 requiring 80 K  arrives Among best fit and first fit, which performs better for this sequence?

A computer has 1000K of main memory. The jobs arrive and finish in the following sequence. Job 1 requiring 200 K arrives Job 2 requiring 350 K arrives Job 3 requiring 300 K arrives Job 1 finishes Job 4 requiring 120 K arrives Job 5 requiring 150 K arrives Job 6 requiring 80 K  arrives Among best fit and first fit, which performs better for this sequence? Correct Answer First fit

Concept:

In the first fit, the allocator places a process in the block which is large enough unallocated memory to hold a process during sequential search.

In the best fit, the allocator places a process in the smallest block of unallocated memory in which it will fit.

Diagram:

Sequence:  Job 1, Job 2, Job 3

[ alt="F1 R.S Pallavi 07.11.2019 D 4" src="//storage.googleapis.com/tb-img/production/19/11/F1_R.S_Pallavi_07.11.2019_D%204.png" style="width: 528px; height: 77px;">

Job 1 Finishes

[ alt="F1 R.S Pallavi 07.11.2019 D 5" src="//storage.googleapis.com/tb-img/production/19/11/F1_R.S_Pallavi_07.11.2019_D%205.png" style="width: 450px; height: 96px;">

[ alt="F1 R.S Pallavi 07.11.2019 D 6" src="//storage.googleapis.com/tb-img/production/19/11/F1_R.S_Pallavi_07.11.2019_D%206.png" style="width: 481px; height: 94px;">

In Best Fit, Job 5 is unable to get the memory for its execution.

Hence First Fit performs better than best fit.

Related Questions