Comment by Dayshine

7 years ago

When I say lock up I mean the UI completely stops. As in, my i3 bar stops updating for several minutes. Not even the linux magic commands let me recover.

On windows things may be unresponsive, but at least ctrl-alt-del responds, and at least the mouse moves!

The main difficulty is I can't tell if my machine has crashed vs is overloaded if the UI doesn't do anything for several minutes.

> Not even the linux magic commands let me recover.

Are you sure you've set up the magic sysctls correctly? Ubuntu ships with magic oomkill disabled, by default.

On all machines I've tried, whenever I've needed it, magic oomkill has always worked, and I've been thankful of the fact that it's implemented down in the kernel.

If you renice the UI processes to a higher-than-normal priority, it should work more like it does in Windows. (This used to be somewhat risky, but today Linux UI is not going to hog your system resources.) The underlying problem is that when memory is tight, Linux starts evicting "clean" pages from the page cache that actually will need to be accessed shortly afterwards (i.e. they're part of the working set of some running process), and thrashing occurs. There's no easy solution to this issue, other than making user programs more responsive to memory pressure in the first place. (This could extend as far as some sort of seamless checkpoint+resume support, like what you see in mobile OS's today.)

  • >There's no easy solution to this issue, other than making user programs more responsive to memory pressure in the first place.

    Well, why can't distributions that come with recommended GUIs just set that high-than-normal priority by default?

    I don't quite understand why the system can't keep what it needs to perform REISUB in memory at all times. Surely that's a tiny program!?

    • > Well, why can't distributions that come with recommended GUIs just set that high-than-normal priority by default?

      Feel free to file bugs for your preferred distro. It would be especially appropriate to do this for critical UI processes like xorg/wayland or lightdm, and for "lightweight" desktops like xfce/lxde that aren't going to cause resource pressure under foreseeable conditions, even when run at higher-than-normal priority.