This is a small howto about changing the swap file size on a Raspberry Pi which runs with a raspbian operating system.
The swap file size is configured in the /etc/dphys-swapfile
file. By default its size is 100 MB. To change that set the CONF_SWAPSIZE
value to something else. Here I chanted it to 500 MB:
CONF_SWAPSIZE=500
Now the dphys-swapfile.service
service needs to be reloaded:
sudo systemctl restart dphys-swapfile.service
To verify the new swap file size type in the free
command:
$ free
total used free shared buff/cache available
Mem: 948296 462200 46824 32152 439272 441208
Swap: 511996 130048 381948
The new swap file size is shown correctly. So we're done.