How do we allocate memory?

Fixed partitioning

split into fixed size blocks. Can lead to internal fragmentation, when process mem is less than partition.

To deal with this, we use buddy allocation , which allows us to have various blocks of size 2^n.

Dynamic partitioning

just put inside free space.

Can lead to external fragmentation. When process is freed, if it lies in between processes memories and it is small, it may be hard to fill it up.

To deal with this, we can shift partitions around to fill up gaps. Note that this is time consuming, since we need to shift an entire block of memory.

We can also rely on Disjoint memory schemes .

This is similar to fixed partitions in a sense that there are discrete sizes (page frame sizes).

However, not all of a process memory has to be contained in one. Instead, memory is “virtually contiguous”, using “logical memory”. Under the hood, this gets mapped to “page frames”, which reside on physical memory.

Mapping is done with page tables.