As I have 128 GB of RAM, I wanted to minimize swap usage by setting vm.swappiness to 10.
I ran a bath (snakemake -j 1) of memory-heavy operations in Python: subtracting two arrays up to 15 GB each, then calculating norms of the difference. Surprisingly my system started to misbehave: Thunderbird crashed, then so did my graphic environment (XFCE with lightdm) effectively killing my screen session with the bath running. Now I wonder: why?
Moreover, my scripts tends to fail with segmentation faults when processing the biggest arrays. Also, after graphic environment respawned it swapped my monitors (pun intended) and did not allow me to re-swap them with Display settings. service lightdm restart after sysctl vm.swappiness=60 was necessary.
I had plenty (932 GB) of swap available, so it is not that my system suddenly ran out of memory. RAM chips also seems to work (17 passes of Memtest86+ revealed no error).
I ask about the reason behind crashes of other programs (Thunderbird, screen session, graphic environment). Even if my programs were poorly written, I would expect their impact to be limited extensive swapping. A total XFCE session restart is something that definitively should not happen. And by restart I mean restart, not freezing or slowdown due to swapping.