Here we are going to create a SWAP of 8GB in size.
Run commands on your linux host in below sequence.
dd if=/dev/zero of=/swapfile bs=1024 count=8388608&
chmod 0600 /swapfile
mkswap /swapfile -f
Add below entry in /etc/fstab file and save the file.
/swapfile swap swap defaults 0 0
Run command free -h to check available SWAP space.