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.

  • 1
    Possible duplicate of How to empty swap if there is free RAM? – Fabby Jun 19 at 12:50
  • Not exactly the same. I can live with this issue, have a script to run "sudo swapoff -a; sudo swapon -a", in fact, I made a script to manage a few swap files to be sure I don't get caught in the irresponsive world of an "out of RAM and out of Swap". What I want to point out is that I have 3 machines using Xubuntu 16.04 and on two of them if I close firefox, for example, I see the swap being swapped-in, however on the third machine that does not happen, even if it has 1BG used RAM and 9GB free RAM. I really think that this machine has a software issue but I am falling to debug it. – Fininho Jun 19 at 17:26

You don't need to worry about it. Have a look for example here. Kernel is tracking it and it can reause space in swap.

  • You have enough rep to flag the question as a duplicate.... – Fabby Jun 19 at 12:51
  • That's the point, I have two other machines were that is true, but on this one, I had been caught by out of RAM and Swap too many times. I think that on this machine the kernel is falling to tracking the swap pages, but I don't know how to debug it. Do you know how can I increase the verbose on the service that manages the memory/swap? – Fininho Jun 19 at 17:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.