Ubuntu: Swap not being used


my swap is not being used, no matter how full my RAM gets. This is my swapon output:

NAME      TYPE       SIZE USED PRIO  /dev/dm-2 partition 31,9G 3,5M   -1  

Could the PRIO -1 be a problem?

cat /proc/sys/vm/swappiness  60  

My swappiness is 60.

cat /proc/swaps  Filename             Type       Size        Used    Priority  /dev/dm-2            partition  33456124    3524    -1  

I have 32GB of RAM and 32GB of swap, but currently when my memory runs my system will just lock up permanently rather than start swapping. Anything I can do about that?

Basically I am trying to run an application that will eat about 30GB of memory, while me physical memory is already half full. While it is booting up and loading data into memory my system just freezes, once the physical memory is full. And no it doesn't appear to just lock up while it is swapping, since even after a while doesn't unfreeze.


Don't think so. First check cat /etc/fstab for your swap partition, then try formatting the swap file system with

  1. sudo swapoff -a
  2. sudo /sbin/mkswap /dev/sd##
  3. sudo swapon -a


Increasing swappiness fixed it. The swap was enabled, but for some reason only used when the memory was completely full, and no sooner.

Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Next Post »