Part 1 of 7 · 1 min read
Why this page comes second
In this module you will
- Place requests into holes with first fit, best fit and worst fit, and trace the result.
- Tell external fragmentation from internal fragmentation, and give an example of each.
- State the 50-percent rule and check it against a simulation.
- Estimate what compaction costs, with a measured copy speed.
- Explain why this scheme leads to paging.
Page 1 gave each process one contiguous region, described by a base and a limit. This page asks how the kernel chooses where each region goes, and what happens as processes start and finish over hours of running. The answer is a problem that every memory manager of this kind meets: the free memory breaks into many small pieces, and a request can fail although the total free memory is large. The problem motivates the design of page 3. The sources are OSTEP chapters 16 and 17, OSC chapter 9, and MOS chapter 3. The simulations were written in Python, and the copy test in C compiled with gcc -O2 -Wall -Wextra.
About this example About this example
Real: The facts, definitions and algorithms on this page come from the books named in the text. No program on this page was timed.
Scripted: Numbers marked "made up to show the idea" were chosen for the examples.
Not real: The page simplifies real systems. Actual kernels add more cases, limits and tuning than a short page can show.