memory, .. cpu?
watch -n 5 free -m
# We can see if the system has any configured swap by typing:
# sudo swapon --show
You can verify that there is no active swap using the free utility:
# free -h
Before we do this, we should check the current disk usage by typing:
df -h
sudo fallocate -l 1G /swapfile
sudo chmod 600 /swapfile
ls -lh /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
sudo swapon --show
free -h
# Back up the /etc/fstab file in case anything goes wrong:
# sudo cp /etc/fstab /etc/fstab.bak
# You can add the swap file information to the end of your /etc/fstab file by typing:
# read about swappiness
# https://www.digitalocean.com/community/tutorials/how-to-add-swap-space-on-ubuntu-16-04
# echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab