Swappiness is a Linux kernel parameter that controls the relative weight given to swapping out runtime memory, as opposed to dropping pages from the system page cache. Swappiness can be set to values between 0 and 100 inclusive.
#Use terminal to see system stats htop
cat /proc/sys/vm/swappiness 10I wanna the swap file only be used when my RAM usage is around 80 or 90 percent. To change the system swappiness value, open /etc/sysctl.conf as root. Then, change or add this line to the file:
vm.swappiness = 10Alternative ways:
# Set the swappiness value as root echo 10 > /proc/sys/vm/swappiness
# Alternatively, run this sysctl -w vm.swappiness=10