Creating a bigger swap file on Linux Mint
For some reason, Linux Mint (and other variants probably?) creates a measily 2GB swap file, which is too small IMHO when you have 16GB or more of RAM installed.
THis is how you increase the swap file in four easy steps.
- Reboot or at least close down all appilcations to free up as much memory as possible = process will be quicker
- sudo swapoff -a # Turn off swap
- sudo dd if=/dev/zero of=/swapfile bs=1M count=16384 # 16384 = 16GB, use 8192 for 8GB and so on
- sudo chmod 0600 /swapfile
- sudo mkswap /swapfile
- sudo swapon -a
You can verify everything worked with
swapon -s
Filename Type Size Used Priority
/swapfile file 16777212 512 -2or
free -m
total used free shared buff/cache available
Mem: 15949 6021 181 233 9746 9367
Swap: 16383 0 16383