Another placement algorithm for dynamic partitioning is refe

Another placement algorithm for dynamic partitioning is referred to as worst-fit. In this case, the largest free block of memory is used for bringing in a process. Discuss the pros and cons of this method compared to first-, next-, and best-fit. What is the average length of the search for worst-fit?

Solution

First-fit:

-->This is simplest of all the storage allocation strategies and best and fastes as well.
-->First-fit begins to scan memory from the beginning and chooses the first available block that is large enough.
-->Here the list of availabale storage is searched and as soon as a free storage block of size>=N is found
the pointerof that block is sent to the calling program after retaining the residue space.
-->example for a block of size 4K,if the first-fit strategy finda block of size 9K.
-->After retaining a storage block of size 5k,4k memory will be sent to the caller.


Best-fit:

-->It t chooses the block that is closest in size to the request.
-->This strategy will not allocate a block of size >N,instead it will continue searching to find a suitable
block so that the block size is closer to the block size of request.
-->example for a request of 2k,if the list contains the blocks of sizes 1k,5k,7k,2.5k then it will find the block
of size 2.5k.
-->From this block after retaining 0.5K,pointer for 2K block will be returned.


Next-fit:

-->It begins to scan memory from the location of the last placement, and chooses the next available
block that is large enough.
-->It\'s strategy is modification of first-fit,In first-fit search will occur at beginning in next-fit
it search from last allocation.
-->In this pointer to the last free list is saved following an allocation and is used to begin search for
subsequent request.
-->The use of this is to reduce the search by avoiding examination of smaller blocks that,in the long run,
tend to tbe created at the beginning of the free list as it happens in the case of first-fit allocation.
-->The result is that the largest block of free memory, which usually appears at the end of the memory space,
is quickly broken up into small fragments. Thus, compaction may be required more frequently with next-fit.


Although each memory request always wastes thesmallest amount of memory, the result is that main memory is quickly littered by
blocks too small to satisfy memory allocation requests. Thus, memory compaction must be done more frequently
than with the other algorithms.


worst-fit:
-->It is reverse of best-fit strategy.
-->allocates largest block available in the available storage list.
-->Used to reduce the rate of production of small blocks which are quite common when the best-fit is used for memory allocaiton.

process speed order

next-fit>first-fit>best-fit,worst-fit

 Another placement algorithm for dynamic partitioning is referred to as worst-fit. In this case, the largest free block of memory is used for bringing in a proc

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site