I am using a Xubuntu 16.04 on my laptop, installed from a dist-upgrade of a Xubuntu 14. The Laptop has 10 GB RAM and 4 GB Swap. Recently I upgraded the kernel to version: 4.15.0-51
The problem is that during normal operation the system is swapping-out over time but never swapping-in back. So after hours/days of uptime, the swap space gets full. Even after closing all the main processes the RAM usage goes to a few hundred MB but the swap remains full. Also, looping over all the /proc/*/stats and grep VmSwap return 0 kB for all processes.
How can I debug why the kernel does is not swapping-in? It's like the kernel is losing track of to who belongs the pages on the swap. I already invest a significant amount of time trying to fix this with no success. The only turn around I have for now is a script that is creating and recycling (swapoff ; swapon) a few swap files.
Thank you for any help.