so… my computer isn’t very powerful. It’s a laptop with 6.71 GiB of RAM, according to the fetch. My swap is the same amount.
during the last two years, I tried using a system with no swap, then with 2 GiB of swap, and now 6.71 (Fedora’s default, which there was no button to change that). The system I was using wasn’t always Fedora, but I don’t think that’s very important.
weirdly, my system seemed most performant when using no swap. When using 2 GiB of swap, it was a bit less fast, but also not as bad as it is right now, with 6.71 GiB of swap. Even when I have just Discord open and nothing else, and I try talking to people in voice chats, I get frequent stutters, people only hear a part of what I’m saying. It makes talking very difficult. The Discord app itself often goes unresponsive. This almost never happened with 2 GiB or no swap, I could even open my Firefox along with Discord voice chats and be fine.
now I’m not tech savvy at all, it could be something else, but naturally, I’m thinking it’s swap, since I heard that swap is a lot slower than actual RAM when it’s being used (which is the case here - it’s often at 0,25-0,45 GiB of swap, sometimes over 1 or 2 GiB, when opening a lot of things).
naturally, a sensible advice would be to purchase more RAM or finally get an ssd instead of hdd. But sadly, my situation is so bad that I’m likely unable to do that for now. So… considering that things worked better when I had less or no swap, I was wondering… perhaps I can restore that now, if there are any ways to decrease / restrict swap usage?
I’m gonna reinstall my system if I get a new drive anyway, which will bring swap back to default, so that’s fine. I’m just looking to make voice chats usable again, for now, while I still can’t get a new drive.
Turning off swap can be done, but expect programs to fail more often.
If you want to do this post the output of the swapon command so we can advise where you need to change the config.
The default config of swap for fedora is using zram, which is the fastest currently available since that is actually using ram.
What you heard is 100% true in varying degrees when using a physical swap device such as your drive, but is 100% false with zram.
It would appear your issue may be, as you suspect, the limited ram you have since fedora by design currently uses about 3G of ram for a clean boot before you even open up any apps. Zram shares the swap space with the OS when there is 8G or less of ram available.
well that’s sad to hear, as I don’t wanna move to any other distro, haha. If there are any ways to fix it, would be great.
also, if this is the case, do you think purchasing an ssd would help here? Or do I just need to purchase more RAM and there’s no way around it? (it’s preferred to fix it without any purchases, but oh well, better to know, in case I get enough money.)
my hdd is over 6 years old by now, and has errors shown on a SMART scan, though overall assestment is “Disk is OK”, and another experienced user here said that my disk is fine, as well.
It runs fedora slow but reasonably well. I have not tried any video conferencing with zoom or similar on it and suspect it would also exhibit the stutter you describe.
What I did to improve performance was add additional swap as can be seen here. For those older and slower CPUs the slowdown from swap to disk is probably not noticeable.
$ free
total used free shared buff/cache available
Mem: 3594200 2120960 169284 7500 1546032 1473240
Swap: 15881208 0 15881208
$ swapon
NAME TYPE SIZE USED PRIO
/dev/zram0 partition 3.4G 0B 100
/dev/sda4 partition 11.7G 0B -2
Note that it is using a little over 2G of ram and currently 0 swap. The only app open is the terminal window.
Gnome is resource intensive and using one of the other spins may be less demanding.
Mine is installed with 4 GB of ram but the actual is shown as 3.59 GiB with the free command above.
Remember that many commands display as GiB while marketing calls it GB so the results seen are different because of unit differences. My 2 TB nvme drive shows as 1.8 TiB and my 32 GB of ram shows as 31.2 GiB
There are several links online for dealing with swap.
A couple I found to be fairly understandable are
and
There are many others, but the gist of it is relatively simple.
create an open space of the desired size on your drive. Partitioning tools such as gparted make this relatively simple.
format that partition as swap using sudo mkswap /dev/sda5. Note that the device name should be exactly what matches the new partition you just created.
use the command sudo blkid /dev/sda5 to get the UUID for the new swap device. Note that we want the UUID and not the PARTUUID.
edit the file /etc/fstab and add a new line entry such as is shown here to automatically activate that new swap at boot time. UUID=735b3be3-779c-4d21-a944-b033225f3ab4 none swap sw 0 0.
Note that the UUID used will be that found in step 3 above.
The swap can be activated immediately with sudo swapon /dev/sda5 if you choose.
Remember that any place I used /dev/sda5 above you should use the device name that is appropriate for your new swap partition. The line in /etc/fstab should use the UUID, and on mine which works perfectly I used the following in /etc/fstab. UUID=cc324719-42ec-4352-98e0-96a8aa988c54 swap swap defaults 0 0
I also would like to disable swap… My use case is that I’m using Fedora cloud image VMs as nodes in a k8s lab and swap needs to be disabled for kubelet.