|
|
|
|
|
by Anderkent
3083 days ago
|
|
> So, in other words, if you have enough memory for your workload that you won't run out, there's no benefit to having swap space (i.e. you've wasted money on memory you don't need). No, that's the opposite. If you have enough memory for your workload that you won't run out, swapping lets you use more memory for disk cache (instead of keeping unaccessed anonymous pages in real ram). Unless by "won't run out" you mean "never have to throw away a disk cache page", which seems very unrealistic. |
|
Except that it doesn't happen in practice, on my systems anyway. If you have plenty of memory, you can keep all your programs in it and as much as the system wants to cache and still not run out.
The theory says that swap effectively buys you some memory to spend on more important things (than what the system chooses to page out). So does buying more memory.
> Unless by "won't run out" you mean "never have to throw away a disk cache page", which seems very unrealistic.
I have an instance of top running on my desktops & laptops all the time. I never see cache using up all of the memory.