Last active
August 12, 2017 01:18
-
-
Save rchrd2/f13bf3f30857d9778512 to your computer and use it in GitHub Desktop.
Create memory swap (virtual memory) on ubuntu
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo swapon -s | |
free -m | |
df -h | |
# 2G, 4G, etc | |
sudo fallocate -l 2G /swapfile | |
ls -lh /swapfile | |
sudo chmod 600 /swapfile | |
ls -lh /swapfile | |
sudo mkswap /swapfile | |
sudo swapon /swapfile | |
sudo swapon -s | |
free -m |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
To make the swap permanent, run: