I have 16 GB of RAM and most of the time I use only half of that. I want to install Endeavor with Plasma.
Should I create a swap partition when installing? Or create a swap file later? Or neither?
Please point me to some instructions on how to do whatever it is recommended that I do.
If it is a desktop computer, donât bother with a swap partition. You can easily create a swap file later if you really need it (with 16 GB of RAM, unlikely). A swap partition is a pain if you ever decide to resize or remove it. Every time I made a swap partition I regretted it. A swap file works just as well and itâs super easy to manage it.
If it is a laptop and you want it to hibernate, then youâll need either a swap partition or a swap file. A swap file is more flexible, but itâs somewhat of a pain to setup your system to hibernate on it, so if youâre lazy and have plenty of storage, just make a swap partition about the same size as your total RAM or slightly bigger (which is also probably an overkill, but you want to be sure your computer always wakes up from hibernation successfully).
If you are using btrfs
as your file system and for some reason you must use an older kernel (version < 5), do some reading about swap files, there may be issues. I have no experience with that. In that case it might be simpler to use a swap partition or just stick to ext4
(or just not use swap at all).
Welcome to the forum.
Disk space is cheap nowadays.
For me swap should always be 2x my RAM.
On my current setup I have 16GB RAM and a 32GB swap partition.
Seconding the swap file. I have 16GB of RAM on my laptop and went with a small swap file, juuuuust in case.
Welcome to the community
I have swapfile on btrfs encrypted lvm. Thanks to archwiki setup was done in a couple of min.
So: yes, some work needs to be done, but it is easy and I recommend to do it.
Welcome to the swap-community!
You naughty boy!
Werft den pösen Puben zu Poden!
Ű±Ù Ù Ű§ÙŰčۧÙŰ© ۧÙێ۱Ù۱۩ ÙÙ Ű§ÙÙ۱ÙÙ!
Ah!
Completely agree. I just added another 8 gigs of ram to have 16 like I prefer and even with 8 gigs I rarely went over 2.5 used. Setup the system with no swap partition or file and Iâm not noticing any performance decrease because of that choice.
I personally always swap. I only have laptops though. I use hibernate a lot. Swap = RAM. If itâs an HDD, itâs a partition, if itâs an SSD, itâs a file.
If itâs a desktop, itâs completely your call. Just remember, no swap, no hibernate.
Is there a reason for this? Iâve heard some stuff about a swap partition being harmful for SSDs (as opposed to a file), but is that something to be concerned about for, say, my laptop with 8GB RAM?
Yes, technically any write operation = bad for SSD = each write reduce itâs lifespan.
Personally i would not use swap for 8 Gb RAM, unless you need to hibernate or do something very heavy routinelyâŠ
With 4 Gb i would think about it maybe
Thatâs pretty much how I think about swap. With 16 GB RAM, itâs unlikely youâll ever need it in normal usage. And if you do happen to need it, making a swapfile is literally 10 seconds of work (and waiting maybe 5 minutes for dd
to do its magic and copy zeroes to it). Or, if you donât need swap, but are really paranoid about running out of memory, you can set up systemd swap.
If you want to hibernate, you need swap, of course. A swap partition is easier to setup for hibernation, but a swap file will always be more flexible.
Iâve got 5 GB of RAM on my laptop, and it needs swap. I made a 7 GiB swapfile for it, just so it can hibernate without any worries. Itâs a bit wasteful, but Iâve got a 2 TiB HDD in it, so I donât care.
But I do notice it writing to the swapfile from time to time, even in normal usage (when opening more than a couple of tabs in Firefox, for example). Not very often, and it rarely uses over 500 MiB of swap, but it does use it.
If it bothers you, try to override default (too aggressive in my opinion) settings:
-
Reduce swappiness
/etc/sysctl.d/99-sysctl.confvm.swappiness=10
-
Reboot
It does not bother me, as it is really rare. But I did set swappiness to 10 on it a long time ago (when I was testing those performance tweaks by librewish). Didnât notice any difference, to be honest
(hmm, my systemâs currently set up to hibernate soon after closing the lidâŠ)
In that case, is a swap partition any more detrimental than a swap file? Iâd be inclined to try replacing my swap partition with a file if itâll extend the lifetime of my SSD.