When I use too much RAM on my Ubuntu 18.10, the GUI freezes. It stops reacting to keyboard and mouse and there is nothing to do other than hard reset the computer.
I believed that this was because the system has swapped out the Gnome binaries to disk and that, eventually, they would be swapped back. But this never happened in the observed timeframe (20 minutes or so).
I tried to solve the problem by disabling swapping (I prefer to lose unsaved work to losing unsaved work and having to restart the PC) and by instructing the OOM killer to kill whichever process has triggered the OOM situation according to this answer. However, this did not help. I tried to use a lot of memory by opening too many browser tabs and the only thing that happened was that the system became unresponsive again.
How is this possible? What other mechanism than thrashing could be involved? (genuine engineering question, not a rant)
I monitored the system stats during this experiment and it seems that the CPU was not running under 100% load, so it was not the computational constraint. Furthermore it seems that the GUI froze before I had the chance to open enough tabs to trigger the OOM killer.
The best theory that I can come up with is that the GUI libraries are using some sort of memory allocator that allows them to continue functioning even with very little memory, either by using some alternative swapping mechanism or by some CPU intensive heap rearrangements. Otherwise I have no clue.
Is there any better explanation for this behavior? Or a solution even?
EDIT
my swappiness:
vm.swappiness = 60
my memory:
martin@martin-UX305UA:~$ free -h
total used free shared buff/cache available
Mem: 7.7G 5.5G 145M 993M 2.1G 975M
Swap: 2.0G 57M 1.9G
my /etc/fstab
UUID=e0edf45b-903c-403f-b2c7-5e69b8b450da / ext4 errors=remount-ro 0 1
# /boot/efi was on /dev/sda1 during installation
UUID=0564-1C88 /boot/efi vfat umask=0077 0 1
/swapfile none swap sw 0 0
sysctl vm.swappiness
. – heynnema May 10 '19 at 23:57sysctl: cannot stat /proc/sys/vm/swapiness: No such file or directory
. I will update my question as soon as I have some reasonable configuration. Thank you for your help! – Martin Drozdik May 13 '19 at 12:05free -h
andcat /etc/fstab
. Try again and report back with your status. – heynnema May 13 '19 at 14:04