Create a swap file (for instance 1gb), format and activate it:

dd if=/dev/zero of=/mnt/swapfile bs=1024 count=1048576
mkswap /mnt/swapfile
swapon /mnt/swapfile

Add the swap file to the /etc/fstab:

/swapfile       none    swap    sw      0       0