Just noticed there is nothing in the official Raspberry Pi documentation that tells you how to increase the amount of swap allocated on Raspberry Pi OS. The default is 200MB (100MB on older releases). Here's how to increase it:
Edit the file /etc/dphys-swapfile:
Change the line that reads:
To something more reasonable, for example:
for a 2GB swapfile. If you want a swap file bigger than 2GB, you will also need to change the line at the bottom of the file that reads:
Take the # symbol off the start of the line, and set this to whatever size you want the swap file to be, along with CONF_SWAPSIZE, e.g.:
HTH
Edit the file /etc/dphys-swapfile:
Code:
sudo nano /etc/dphys-swapfile
Code:
CONF_SWAPSIZE=200
Code:
CONF_SWAPSIZE=2048
Code:
#CONF_MAXSWAP=2048
Code:
CONF_MAXSWAP=8192
Statistics: Posted by andrum99 — Fri Jul 26, 2024 2:09 pm