My ubuntu 18.04 64bit isn't using the swap file/partition to the point when the 8gigs(of which 7.3 are usable) of ram almost fills up, and when it does, and actually writes some things in swap it freezes/becomes unresponsive after a couple of hundreds of MB, usually when 750MB+ is written into swap.
I have googled similar problems and so far tried a few different things but nothing works.
This happened on another Ubuntu install on the same machine that had a 2GB swap partition created by the installer automagically, it happened on the current Ubuntu install where I allocated 15G of space for a proper swap partition, and again when I created a 5G swap file.
I also tried increasing swappiness from the default 60 to 80, but still, Ubuntu doesn't use the swap until I reach the 6-7G mark of used ram, and then if I'm lucky I can navigate with alt-tab and restart the computer, sometimes if it's really bad the mouse stops responding, other times the mouse clicks do absolutely nothing inside open windows(it does close the windows occasionally, and can navigate through web pages using the keyboard), waiting for minutes usually is futile, and if it freezes completely I can only restart using REISUB.
Any ideas?
Edit: i will try the suggestions in the comments. I already tried decreasing the swappiness to 15 as suggested, And I haven't experienced freezes since, although I was only able to fill the ram twice since(probably somethings leaks memory in the long run) - it wasn't much in the swap only 35-175MB.
inxi
on the host then runinxi -t m20
to show you the top 20 memory hogs of the system. The idea is to avoid needing to use swap on the system. Also look into settings forvm.swappiness
on your system to a lower number like 10 or 1 as well to try to avoid it as much as possible. The higher the number the more swapping happens. 60 means when the ram hits 40% to swap. – Terrance Dec 06 '18 at 14:31