Contiguous Memory Allocation
The 3 most used strategies are:
- First fit: the OS searches the list of holes until one is found that is big enough to satisfy the request, and assigns a portion of that hole to that process. Whatever fraction of the hole not needed by the request is left on the free list as a smaller hole.
- Best fit: the OS allocates the smallest hole that is big enough to satisfy the request. If the OS sorts the list of free memory chunks by the chunk size, the OS could speed up the process of finding the right hole.
- Worst fit: the OS allocates the largest hole available, thereby increasing the likelihood that the remaining smaller hole will be usable for satisfying future requests.
Simulations show that either first or best fit are better than worst fit in terms of both time and storage utilization. First and best fits are about equal in terms of storage utilization, but first fit is faster.