Question

Consider a swapping system in which the memory map consists of the following whole sizes in...

Consider a swapping system in which the memory map consists of the following whole sizes in memory order: 10K, 4K, 20K, 18K, 7K, 9K, 12K, and 15K. Draw the allocation sequence for the successive memory size requests of: (i) 12K, (ii) 10K, (iii) 9K using the following memory allocation requests:

(a) First Fit

(b) Best Fit

(c) Worst Fit

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Hi,

I hope you’re doing well.

In the given question :
Available sizes in the memory are as under :
10K, 4K, 20K, 18K, 7K, 9K, 12K, and 15K
Memory allocation request are as under:
12K, 10K, 9K

So now we need to do all request as per the following fit approaches:

(a) First Fit

(b) Best Fit

(c) Worst Fit


First fit : for allocating the hole, first scans the memory holes from starting(that is why first fit) such that the available hole size should be greater than or equal to the requested segment.

soultion : First fit

a)12k ---> 20k (first occurence is 20K which is greater than 12K)

b)10k ---> 10k (first occurence is 10K which is equal to 10K)

c) 9k ---> 18k (first occurence should be 10K but 10K, 20K are already filled in above parts(b) and (a) respectivley, that is why 18K is first fit which is greater than 9K )


Best fit: for allocating the hole, first scans the memory holes from starting until to find minimum hole size greater than or equal to requested segment.

Solution : Best fit

a) 12k ---> 12k (Since it is only the available hole with size equal to request segment size)

b) 10k ---> 10k (Since it is only the available hole with size equal to request segment size)

c) 9k ---> 9k (Since it is only the available hole with size equal to request segment size)

Worst fit: It is the just opposite to best fit. For allocating the hole, first scans the memory holes from starting until to find maximum hole size greater than or equal to requested segment.

Solution : Worst fit

a) 12k ---> 20k (Since it is only the available hole with size greatest than requested segment size)

b) 10k ---> 18k (Since 20K should be the greatest but its is filled in above part so only the available hole with size greatest than requested segment size is 18K)

c) 9k ---> 15k (Since 20K,18K should be the greatest but these are already filled in above parts (a) and (b) respectively, so only the available hole with size greatest than requested segment size is 15K)

Note : Do like and comment if you have any queries. I would be very happy to resolve all your queries.

Thank You !

Add a comment
Know the answer?
Add Answer to:
Consider a swapping system in which the memory map consists of the following whole sizes in...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT