6 ms·
Do current operating systems ever page out memory to swap when not necessary, in order to make room for more disk cache in RAM?
by TorKlingberg 10y ago
Do current operating systems ever page out memory to swap when not necessary, in order to make room for more disk cache in RAM?
- saurik 10y agoIf OS's stopped doing this at some point, I'd be shocked: this is why having memory and swap is valuable.
- deathanatos 10y agoYou'll be shocked, then. Linux under the default settings won't swap unless there is pressure to do so. Windows will. It's a tradeoff: if you swap something out while not under pressure, that could be the thing you next need, resulting in it just getting swapped back in. Or, maybe not and the extra cache is useful (but if you're not under pressure, maybe letting go of older cache, instead of swapping something out, is a better trade: letting go of old cache doesn't require swapping out, since it's by-definition backed by disk.)
- pvdebbe 10y agoWindows' approach is painful if you run it on slow HDDs like I did 15 years ago before switching to linux, full time.
- PeCaN 10y agoWindows does this very aggressively. It's built in to the I/O subsystem, actually, and (IIRC—it's been a bit since I've messed with this) IOCP calls execute immediately (on the same thread, avoiding any context switches) when requested data is already cached.
- kalleboo 10y agomacOS does this aggressively. I'm currently at 8 GB used/16 GB, and still have 5 GB swapped out.