I have a 16GB RAM system and whenever I hit the limit of RAM the whole system freezes even the mouse cursor starts to become jittery until it doesn't move at all. Keyboard, mouse, nothing. So I am forced to do a hard power-off which isn't probably good for the electronics.
I've set up a 16GB swap which shows up properly in free -m
and in top
but it's always at 0 usage.
total used free shared buff/cache available
Mem: 15960 5823 3915 704 6220 9104
Swap: 16383 0 16383
Any ideas why my system doesn't want to use the swap to save me from a total crash?
More info:
$ grep -i swap /etc/fstab
/swapfile none swap sw 0 0
$ sysctl vm.swappiness
vm.swappiness = 80
$ swapon -s
Filename Type Size Used Priority
/swapfile file 16777212 0 -2
$ ls -al /swapfile
-rw------- 1 root root 17179869184 Jan 16 2021 /swapfile
Output of sudo lshw -C memory
: https://pastebin.com/TGbjiLdm
I've played with the swappiness from 10 to 40 to 60 to 80 and it doesn't seem to make much difference.
Also, the system isn't hitting the limit very often. Only when I am editing very large video files with Kdenlive or running VirtualBox and things of that nature. I'm usually careful about it, but sometimes I accidentally hit that threshold of 16GB (with swap unused) and my system crashes.
used
is0
in my post. – thorie Aug 06 '21 at 15:15man swapon
and, if swap is setup in/etc/fstab
,sudo swapon -a
. – waltinator Aug 06 '21 at 18:11grep -i swap /etc/fstab
andsysctl vm.swappiness
andswapon -s
andsudo lshw -C memory
. Start comments to me with @heynnema or I'll miss them. – heynnema Aug 06 '21 at 18:46