Increase RAM Capacity
Use a memory card as extended cache for RAM to avoid system lag when many services have to run at the same time in a short period.
Check the amount of RAM being used: $ htop or free --mega

Increase RAM Capacity
Disable the swap file:
sudo dphys-swapfile swapoff
sudo nano /etc/dphys-swapfile
Declare the Swapfile
SWAP_SIZE=1G && SWAP_FILE=/swapfile && sudo swapoff -a && sudo rm -rf $SWAP_FILE && sudo fallocate -l $SWAP_SIZE $SWAP_FILE && sudo chmod 600 $SWAP_FILE && sudo mkswap $SWAP_FILE && sudo swapon -aEnable the swap file:
sudo dphys-swapfile swapon
Create a new swap file:
sudo dphys-swapfile setup