top | item 47160278

(no title)

Sohcahtoa82 | 5 days ago

None of the answers are satisfying to me, tbh.

I install more RAM so I can swap less. If I have 8 GB, then the 2x rule means I should have a 16 GB swap file, giving me 24 GB of total memory to work with. If I then stumble upon a good deal on RAM and upgrade to 32 GB, then if I never had memory problems with 24 GB, then I should be able to completely disable paging and not have a problem. But instead, the advice would be to increase my paging file to 64 GB!?

It doesn't make any sense. At all.

discuss

order

Dylan16807|5 days ago

It's not meant for that kind of comparison. It's a variant of Simpson's paradox. Any individual system with a fixed set of tasks needs less swap when it gets more RAM. But when you look at the aggregate of systems, the systems that have more tasks to run get more RAM to run them, and systems with fewer tasks get less RAM. And since more tasks need more swap, everything scales together (though often not linearly).

PeterisP|5 days ago

The key parameter for swap size is "how memory-hungry things you want to run", which isn't easy to measure, but paying for installed RAM is a somewhat usable proxy metric for that. If you were happy with 8gb, it's some evidence that your apps don't need much memory (and swap), but if you needed to pay for an upgrade to 32gb, that's some evidence that you're the kind of user who needs much more swap than those with 8gb of RAM.

anyfoo|5 days ago

I'm getting tired of typing this, but swap space is not just to increase available virtual memory. If you upgrade from 8 GB to 24 GB, then with proper swap space usage, you have 16 GB that could be used for additional disk cache.

Sure, you're still better off with 24 GB overall compared to 8GB+swap whether you add swap to your 24 GB or not, but swap can still make things more better.

(That says nothing about whether the 2x rule is still useful though, I have no idea.)