Answer:
First Fit - Allocated Memory 20 MB, 10 MB, and 18 MB.
Next Fit - Allocated Memory 20 MB, 18 MB, and 9 MB.
Best Fit - Allocated Memory 12 MB, 10 MB, and 9 MB.
Worst Fit - Allocated Memory 20 MB, 10 MB, and 15 MB.
Step-by-step explanation:
Memory Management Systems basically have four types - First Fit, Next Fit, Best Fit and Worst Fit. These memory systems work differently to allocate the memory in operating system.
Given-
We have memory sizes - 10 MB, 4 MB, 20 MB, 18 MB, 12 MB and 15 MB.
and we have to allocate these queued requests - 12 MB, 10 MB and 9 MB.
First Fit Method -
In the first fit process starts with the very first memory hole and it checks that memory should be allocated in the memory size as whole.
So that the First fit will be 20 MB, 10 MB, and 18 MB.
Next Fit Method -
- Next Fit method works similarly to the first fit. the first step in both the methods is same. but in the next fit, in the second step it put the pointer on the previous allocated memory and then start allocating the next one just after that.
- Advantage of next fit is you need not to search from the beginning again and again.
Thus, the allocation in next fit is 20 MB, 18 MB, and 9 MB.
Best Fit Method -
As the name tells, in this method it go thorough the entire list and tries to find the best allocation with minimal internal fragmentation.
Thus, the best fit allocation is 12 MB, 10 MB, and 9 MB.
Worst Fit Method -
- The Worst fit method is totally opposite to the best fit method. in this method it tries to find the maximum internal fragmentation.
- in best fit and the worst fit one thing is same that both the process search the entire list again and again.
So that, the allocation in worst fit will be 20 MB, 10 MB, and 15 MB.
I hope it worked for you!