Memory Allocation

  • First, fit. Allocate the first hole that is big enough. Searching can start either at the beginning of the set of holes or at the location where the previous first-fit search ended. We can stop searching as soon as we find a free hole that is large enough.
  • Best fit. Allocate the smallest hole that is big enough. We must search the entire list unless the list is ordered by size. This strategy produces the smallest leftover hole.
  • Worst fit. Allocate the largest hole. Again, we must search the entire list, unless it is sorted by size. This strategy produces the largest leftover hole, which may be more useful than the smaller leftover hole from a best-fit approach. Simulations have shown that both first fit and best fit are better than worst fit in terms of decreasing time and storage utilization. Neither first fit nor best fit is clearly better than the other in terms of storage utilization, but first, fit is generally faster.




Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Tips For Every Full-Stack Developer In 2020

Using Containerization to execute Python programs

Creating a Button in Rails

Synthesis of Rivermen

MonkeLabs and the Launchpad NFT Meta

DockerCon 2022 : What I learned

SwiftUI: What you need to know for your next technical interview

Malt Tech Days, product and tech culture on steroids

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Adith - The Data Guy

Adith - The Data Guy

More from Medium

Algorithm in C++

28. Implement strStr()

Overflow occurs of number in MatLab and in C.

All about algorithms and functions