In First-fit, scan the memory from the beginning and allocate the first available block that is large enough. It is one of the fastest algorithms as it would search only as little as possible. But, the remaining unused memory areas left after allocations become waste if it is too smaller. Thus request for large memory requirement cannot be accomplished. We will prove that the following problem, which algorithm makes the most efficient use of memory.
In First fit memory allocation scheme, the operating system searches that can –
Example:
Given 5 partiton of size 5KB, 3KB, 1KB, 4KB and 1 KB respectivly, if a new process A of 1KB arrives to main memory it is alloted to partition 1 of size 5.
Implementation of First-fit
Try out first fit allocation in variable task with visualising the process allocation in main memory
Go to simulatorTry out first fit allocation in fixed task with visualising the process allocation in main memory
Go to simulator