1. Stop the swap

dphys-swapfile swapoff
  1. Modify the size of the swap

As root, edit the file /etc/dphys-swapfile and modify the variable dphys-swapfile:

CONF_SWAPSIZE=1024
  1. Start the swap

dphys-swapfile swapon