0
2.6kviews
Discuss partition selection algorithm in brief.

Give memory partition of 150k, 500k, 200k, 300k & 550k (in order), how would each of the first fit, best fit and worst fit algorithm place the processes of 220k, 430k, 110k & 425k (in order). Which algorithm makes the most efficient use of memory?


Subject: Operating System

Topic: MEMORY MANAGEMENT

Difficulty: Hard

1 Answer
0
64views

Given memory partition: 150k, 500k, 200k, 300k & 550k (in order)

Process requiring spacing

220k, 430k, 110k & 425k (in order)

1. First Fit

(a)

enter image description here

The first process arrives with the requirement of 200k memory. As we search through the memory partition. The first partition which would fit in the current request is a hole of 200k.

(b)

enter image description here

For the next process memory partition would be searched again from beginning. A hole which would satisfy 430k requirement is 500k leaving 70k of memory unused.

(c)

enter image description here

For the next request of 110k, again the search start from beginning and the memory hole satisfying the request would be 330k leaving 220k of memory unused.

(d)

enter image description here

The last request of 430k would be satisfying by the available memory hole of 550k leaving 125k of memory unused.

2. Next Fit

This algorithm start searching for next memory hole, where it stopped last time.

enter image description here

(a) First request 200k satisfied by 200k memory hole

(b) 2nd request 430k satisfied by next suitable memory hole i.e. 500k the lest space is 70k

(c) 3rd request 110k satisfied by remaining 220k

(d) 4th request 430k satisfied by 500k memory hole.

3. Best Fit

This algorithm chooses the free block closest to the requested size.

enter image description here

Please log in to add an answer.