on the rhel version 7.5 the used swap is 12G
we change the swappiness from 10 to 1
echo 1 > /proc/sys/vm/swappiness
sysctl -w vm.swappiness=1
echo "vm.swappiness = 1" >> /etc/sysctl.conf
and did the
swapoff -a && swapon -a
then from free -g
we still see the same used swap size
so seems that the change to swappiness , and swapoff -a && swapon -a
, not help to decease the swap use
the only thing that I think to do is to reboot the linux machine
is it make sense ?
free -g
after youswapoff -a
only, skipping theswapon -a
? Does it make the swap size 0? – GMaster May 08 '20 at 06:27swapoff -a
only, and if it is successful, the swap will read0
in all columns. Looks like your OS is having issues turning off swap in the first place. – GMaster May 08 '20 at 06:42