Linux/Swap: Difference between revisions

From Wiki
mNo edit summary
mNo edit summary
Line 12: Line 12:
sudo swapon /swapfile
sudo swapon /swapfile
</pre>
</pre>
== Change swappiness ==
<pre>
cat /proc/sys/vm/swappiness
sudo sysctl vm.swappiness=10
</pre>




[[Category:Linux/System]]
[[Category:Linux/System]]
[[Category:Linux]]
[[Category:Linux]]

Revision as of 22:45, 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

Change swappiness

cat /proc/sys/vm/swappiness
sudo sysctl vm.swappiness=10