3 ms·
I’m still confused on swap. What’s the practical difference (besides speed) between 16 GB or RAM and 16 GB of swap versus 32 GB of RAM and 0 swap?
by colejohnson66 6y ago
I’m still confused on swap. What’s the practical difference (besides speed) between 16 GB or RAM and 16 GB of swap versus 32 GB of RAM and 0 swap?
- NikolaeVarius 6y ago16 GB of SSD space is cheaper
- deleted 6y ago[deleted]
- colejohnson66 6y agoBut if I upgrade to 32 GB or RAM, would I even need the swap? I guess my question is: why is swap not dynamic like pagefile.sys on Windows? The pagefile grows and shrinks as it’s needed. But a swap partition doesn’t; it’s size is set at creation.
- SomeoneFromCA 6y agoYo do not need a partition, you can use a file.
- dTal 6y agoTrue. It's still a fixed size. (It's also slower. The reason we use partitions is to avoid invoking a whole heap of filesystem code every time we want to access some memory.)
- bb88 6y agoWhat's your workload like, do you run a lot of heavy servers for development? Or do you mostly do browsing? A growing/shrinking swap file doesn't really add anything, especially if you're thinking a 1:1 relationship with memory and swap. To me it seems like 16GB of HD space isn't that big a deal. You can also play around with swap performance if you want temporarily. https://linuxize.com/post/create-a-linux-swap-file/ https://linuxize.com/post/create-a-linux-swap-file/ Yes, it's going to be slower since you're using a file in a filesystem rather than using a dedicated partition, but it would give you a way to test it out. Some workloads will do better since the unused pages will get sent to disk.
- eurekin 6y agoI'm in the same boat with that. What makes 16GB RAM + 16GB swap acceptable, when 32GB of just RAM is the same size and faster? Why, 32GB of RAM only needs extra swap?