This diagram shows an example of memory configuration under

This diagram shows an example of memory configuration under dynamic partitioning, after a number of placement and swapping-out operations have been carried out. Addresses go from left to right; gray areas indicate blocks occupied by processes; white areas indicate free memory blocks. The last process placed is 2-Mbyte and is marked with an X. Only one process was swapped out after that. What was the maximum size of the swapped-out process? What was the size of the free block just before it was partitioned by X? A new 3-Mbyte allocation request must be satisfied next. Indicate the intervals of memory where a partition will be created for the new process under the following four placement algorithms: best-fit, first-fit, next-fit, and worst-fit. For each algorithm, draw a horizontal segment under the memory strip and label it clearly.

Solution

A) As allcoation happes from left to right, hence while X got it\'s palce in memory, there should have been some process to the right of X. In current picture there is an empty fragment of 1MB right of X, hence this should be a process which got swapped out. (Max size of swappwed out process is 1MB)

B)Size of a black just before it got partitioned by X = size of X + size of empty block which is left of X = 2 + 5=7MB

C) 3 MB allcoation with following stategies.

1)Best Fit: The right most 3MB vacant slot.

2)First Fit: First block from left to right which satisfy the need, That is right most 4MB vacant slot.

3)Next Fit: Next vacant block after X which have space for 3MB allocation, that is 5MB empty slot.

4) Worst Fit : The max possible empty slot, that is 8MB

 This diagram shows an example of memory configuration under dynamic partitioning, after a number of placement and swapping-out operations have been carried out

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site