Linux/Swap: Difference between revisions
< Linux
mNo edit summary |
|||
Line 11: | Line 11: | ||
sudo mkswap /swapfile | sudo mkswap /swapfile | ||
sudo swapon /swapfile | sudo swapon /swapfile | ||
</pre> | |||
== Add to /etc/fstab == | |||
<pre> | |||
</pre> | </pre> | ||
Revision as of 22:49, 19 November 2023
Status
sudo swapon --show free -m
Create swapfile
sudo fallocate -l 4G /swapfile sudo chmod 600 /swapfile sudo mkswap /swapfile sudo swapon /swapfile
Add to /etc/fstab
Change swappiness
cat /proc/sys/vm/swappiness sudo sysctl vm.swappiness=10
- /etc/sysctl.conf
vm.swappiness=10