Ubuntu – What do I do when extensive SWAP access makes system dead

chromiumramswap

Memory is getting low and heavy SWAP access makes my system responding very slowly at first, but if I don't react by freeing a lot of memory, the system becomes like almost completely dead. Now I have this ridiculous situation where I can't even log in, while the system and programs are still running and constantly swapping gigabytes of memory back and forth.

The graphical login does not even appear. After I pressed Ctrl-Alt-F1 and waited a couple of minutes, the text login appeared. But when I enter my login name, it says 60 seconds later, but before the password login prompt even appeared "login timed out after 60 seconds". Sometimes I get to the password prompt, but still it times out after 60 seconds. I am still trying right now, anyone has a better idea? I can't even properly shut down like this. Actually it would be enough to close some Chromium tabs (or kill their tasks), just how?

By the way, it is only one program and one website that causes alle this havoc: Chromium and Facebook. Though Facebook renders very fast in Chromium, it uses a lot of memory – like a couple of hundred MB for each tab. And as those FB tabs are updated and each contains a chat window, scrolling updates etc. the memory usage constantly grows. This time I had around 20 tabs opened, many of them were FB tabs.

System: AMD64 3.5 GB RAM, Ubuntu 13.10 (64 Bit)

Swap is encrypted. I don't know if not using disc encryption would make a difference.

Best Answer

You're experiencing thrashing due to exhaustion of physical memory, so the system is constantly swapping memory pages in and out of disk.

http://en.wikipedia.org/wiki/Thrashing_%28computer_science%29

Three possible solutions:

  1. Buy more RAM
  2. Try a different browser to see if it has a lower memory usage until you can get more RAM.
  3. Don't open so many facebook tabs until you buy more RAM.

As to how to do a proper shutdown, you can try the REISUB sequence (http://kember.net/articles/reisub-the-gentle-linux-restart/). Failing that, you'll probably just have to risk power-cycling the system.

Related Question