It is possible to configure the behavior of Linux with regards to the use of swap memory. The default setting is a swappiness of 60, which means the kernel begins using swap memory once processes use 40% of the system memory.

To view the current swappiness setting, use the command
cat /etc/sysctl.conf | grep swappiness or use the command
cat /proc/sys/vm/swappiness or the command
/sbin/sysctl vm.swappiness

To immediately change swappiness, use the command
sysctl vm.swappiness=1 or another number other than 1. In the case of 65536MB of RAM, a swappiness setting of 1 means that once 655MB of memory remains, the kernel will start swapping data to the disk.

To make the change permanent, add vm.swapiness=1 to /etc/sysctl.conf. It is also possible to achieve the same effect by adding the sysctl vm.swapiness=1 command to a crontab that takes effect upon reboot using @reboot /sbin/sysctl vm.swappiness=1 in the crontab editor.

Document z260521wa, last modified 21 May, 2026
See z260205f (earlier referece note on configuring swappiness)

Website
          Counter