Strange swap behavior

Recent time observing strange situation: custom app with memory leak eats all the memory (16GB size) and apps unloading to the swap (16GB as well), after killing problematic app, can’t get system to work again: KSysGuard shows many processes waiting on disk like:

  • plasmashell
  • firefox
  • etc

and they become unresponsive to keyboard, mouse, etc. So forced to kill and restart them as well and even reboot PC as there are many others processes appear in “unknown” or “waiting on disk” states. Why kernel, KDE or whatever do not load apps to the memory again? How to solve this?

What happened to Linux?! In 2.x versions swap works perfect unloaded applications to swap and put them back immediately like a charm.

Problem also described here:
https://bugzilla.suse.com/show_bug.cgi?id=1114589#c33
https://bugzilla.suse.com/show_bug.cgi?id=1114589#c23

Forced to set -s 100,100 for earlyoom to not use swap at all and kill the app over critical level of memory.

I note this upstream bug…
https://bugzilla.kernel.org/show_bug.cgi?id=196729

Uh… since 2017. Something strange happens in Linux community - corporations? :wink: Any chance it will be fixed? Workarounds?

I’ll leave others to comment more about that. Just sharing what I found. Some have noted that it seems to be evident for those using btrfs (which I don’t).

I have ext4 only.