title: Implement a real time best-fit memory allocation algorithm in c/c++
body: <p>We have this algorithm called "best-fit" that the Operating System uses to assign memory to processes that needs it. So what I wanted to do is, make a C code that can find the holes in the system's memory and fit processes to it, in real time,like what any OS does. I am trying to implement this on a Linux system.I know that /dev/mem acts as a interface to the physical memory, so I was going to try to use the hexdump of /dev/mem to somehow get the holes in the system memory. But I do not know whether that is the best way of doing this. So, Can someone please help point me in the right direction on how to go about implementing something like this? </p>