What is SWAP memory?
SWAP memory is basically parts of memory from the RAM (Random Access Memory) that enables an operating system to provide more memory to a running application or process than is available in physical random access memory (RAM). So if the physical memory (RAM) is full, we can use SWAP partition for extra memory resources. It is useful if we have low memory on our machine.
How to increase SWAP size in Raspbian OS
Step 1: Stop the SWAP
sudo dphys-swapfile swapoff
Step 2: Modify the SWAP size
root, edit the file
/etc/dphys-swapfile and modify the variable
sudo nano /etc/dphys-swapfile
Edit the line and enter decide swap size in MB
Step 3: Create and initialize the file
sudo dphys-swapfile setup
Step 4: Start the SWAP
sudo dphys-swapfile swapon