My Swap space is currently set to 2 GB. How do I increase it?
Also I'm running with an SSD and have 16GB of RAM. What is the Max Memory I can set the swap file to?
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It only takes a minute to sign up.Sign up to join this community
OK - That was a lot less scary than I thought it was going to be. I increased the swap size to 8 GB with the following sequence (Based on the 3rd answer in the linked post - Note that I had to turn off swap first - If you look at your system monitor you will see Ubuntu emptying out your swap space as you run the first command):
sudo swapoff /swapfile sudo fallocate -l 8G /swapfile sudo chmod 600 /swapfile sudo mkswap /swapfile sudo swapon /swapfile
sudo swapon --show
Make it permanent:
echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab
This worked great and my laptop stopped freezing due to memory hogging by Chrome. One of the comments asserted that 16GB is enough, and in general I agree, but this is what my situation looks like: