8 GB RAM = recommended 8 GB SWAP for safety.
With 16 GB RAM and more SWAP is useless (mostly scenario).
Hibernation is Windows thing. Does not work properly in Linux at all.
As always - it depends. Is it a laptop or desktop PC? For desktop hibernate makes no sense. Swap is useful if you operate lot’s of memory consuming programs in parallel or if you are compiling code or often install fresh AUR packages. If you don’t use hibernation than a swap file could be a good alternative as well. Be aware that the system performances drops dramatically when swap is used. So, if you are not a coder 4 GiB swap should be fine just to avoid crashes when running out of RAM. For this question you might get as many different answers as forum users enter this thread.
If you still want to use hibernation you need the resume kernel parameter set in /etc/default/grub and you need the resume HOOK /etc/mkinitcpio.conf.
When Linux was first written “640K is more memory than anyone will ever need”. So, now days 8Gb really is more than most systems need. Yes, there are exceptions to that rule, but most of them have to do with WinBlows.
The thing that Swap is mostly used for in Linux is, RAM dump on crash for debuging. Or save state on Hibernation, as others have noted.
The short answer now days is “No”. With the caveat emptor that if your system uses RAM dump or hibernation, then “Yes”… at about 2Gb disk for each 1Gb RAM.
Put a swap on your system and log how often it’s used (assuming you don’t have RAM dump or hibernation).
If you have a bloated system… live wallpaper, widgets and doodads all over your desktop, 30 or 40 tabs/windows open at one time… yeah, your going to need RAM/swap, and lots of it.
Or you could run a cleaner distro/desktop interface. I still have systems around here with 4Gb of RAM, running Lubuntu, and hardly ever dig into swap. (admittedly I don’t play modern games on 4Gb, but I still do HTML5 games on Firefox and that’s know to have problems eating up RAM)
Even if you do run out of RAM, it will just bottleneck until some frees up, and that’s usually not much worse than the bog-down from swap.
P.S. Thanks for reading and understanding my whole post, not just pulling one line out and reading it out of context.
I think Manjaro is a popular os for Linux-gamers, in such a situation I think swap might be something such user needs even with 16GB with certain games. Anyway I should test this myself (I have a swap partition).
Even if you do run out of RAM, it will just bottleneck until some frees up, and that’s usually not much worse than the bog-down from swap.
Hi !
I ALWAYS setup swap, whichever RAM size. even with an aggressive swappiness, attempting to maximize RAM use, I see suff in my swap.
Here an exemple with a long session, 3 Firefox profiles with lots of tabs, Gimp, Shortwave & pulseeffect :
But, as I don’t know if it’ll be used and what size I should set, I use systemd-swap.
To optimize it, I create a file : /etc/systemd/swap.conf.d/overrides.conf
Where I add to default setup :
There is rarely such a thing as the best solution. It always depends on what you want to do, then some solution can be helpful to achieve your goal. The same solution can become a hinderance in other cases.
Interesting. I have 32 GB as well, with a 500 MB swap file. I do see some swap use from time to time in a ballpark of tens of megabytes, with swappiness set to 20. And I haven’t used the system for anything memory intensive since I installed Manjaro about three months ago
Nothing special… I have 6 gb ram which is shared with graphics card…I just want smooth multitasking, browsing and gaming (only fm20). Most of the time while I am using chrome, few tabs opened, laptop slows