In Worst-fit, the entire list of blocks must be searched the largest block and allocate this block. Reduce the rate of production of small gaps. In contrast, this strategy produces the largest leftover block, which may be big enough to hold another process. But, if a process requiring larger memory arrives at a later stage then it cannot be accommodated as the largest hole is already split and occupied.
In Worst fit memory allocation scheme, the operating system searches that can –
Example:
Given 5 partiton of size 3KB, 5KB, 2KB, 4KB and 1 KB respectivly, if a new process A of 1KB arrives to main memory it is alloted to partition 2 of size 5KB which leaves memory wastage of 4KB.
Implementation of Worst-fit
Try out worst fit allocation in variable task with visualising the process allocation in main memory
Go to simulatorTry out worst fit allocation in fixed task with visualising the process allocation in main memory
Go to simulator