Professional Documents
Culture Documents
ANS. Swapping:
A process must be in the main memory before it starts execution. So, a process
that is ready for execution is brought in the main memory. Now, if a running the
process gets blocked. The memory manager temporarily swaps out that blocked
process on to the disk. This makes the space for another process in the main
memory. So, the memory manager swaps in the process ready for execution, in
the main memory, from the disk. The swapped out process is also brought back
into the main memory when it again gets ready for execution.
1. First Fit
In the first fit approach is to allocate the first free partition or hole large enough
which can accommodate the process. It finishes after finding the first suitable
free partition.
2. Best Fit
The best fit deals with allocating the smallest free partition which meets the
requirement of the requesting process. This algorithm first searches the entire
list of free partitions and considers the smallest hole that is adequate. It then
tries to find a hole which is close to actual process size needed.
3. Worst fit
In worst fit approach is to locate largest available free portion so that the portion
left will be big enough to be useful. It is the reverse of best fit.
Advantage:
Since this process chooses the largest hole/partition, therefore there will be large
internal fragmentation. Now, this internal fragmentation will be quite big so that
other small processes can also be placed in that leftover partition.
Disadvantage:
It is a slow process.