When Replacements Really Occur
Explore how operating systems manage memory replacements not only when memory is full but proactively through background swap daemons. Understand high and low watermarks' roles, how pages are evicted efficiently in batches, and how background processing improves disk performance and system responsiveness during swapping.
We'll cover the following...
Thus far, the way we’ve described how replacements occur assumes that the OS waits until memory is entirely full, and only then replaces (evicts) a page to make room for some other page. As you can imagine, this is a little bit unrealistic, and there are many reasons for the OS to keep a small portion of memory free more proactively.
Swap daemon or page daemon
To keep a small amount of memory free, most operating systems thus have some kind of high watermark (HW) and low watermark (LW) to help decide when to start evicting pages from memory. How this works is as follows: when the OS notices that there are fewer than LW ...