I run ubuntu on 4 Gb of RAM, and found the system still using 20% of Swap although the RAM is only 57% full and swappiness set to 5.

swap and memory usage

The result of cat /proc/sys/vm/swappiness is 5.

Is this is normal? Or is the swappiness setting not being read at all?

Note : The question is not about how to set swappiness, but rather why after setting the swapiness to a very low number, ubuntu still used a lot of swap although there are plenty of memory to use.

  • Related: This post on Unix & Linux has answers to explain "What does the vm.swappiness parameter really control?".
    – user37165
    Nov 24, 2015 at 10:28
  • 1
    @clearkimura this is not a dupe. The linked question is about setting swappiness. The OP has already done so and is concerned that it doesn't seem to be working as expected.
    – terdon
    Nov 24, 2015 at 10:37
  • @terdon Initially I read the answers over there and found some relevant text, which include "try changing the swappiness value"; "Once data is in swap, when does it come out again?"; "Setting the swappiness value doesn't work in every situation"; "Once swap has been used for a program it tends to remain mapped for the life of the program" (copied from each answers there). If OP has tried with other values of swappiness and result remain the same, then it is not a dupe after all.
    – user37165
    Nov 24, 2015 at 14:23
  • 1
    @clearkimura in my case, i have done restart multiple times after changing swappiness, and still the swap is used a lot although the swappiness value remain after restart. I wonder if anyone experience the same thing, or its just me.
    – hudarsono
    Nov 25, 2015 at 16:49
  • @hudarsono I assume the swap is used from beginning i.e. right after log in to Desktop? It might be useful to observe beyond task manager, such as what applications are run at startup and other related things.
    – user37165
    Nov 27, 2015 at 3:53


You must log in to answer this question.

Browse other questions tagged .