Add memory for your ubuntu (memory swap)
#Switch to the root environment sudo su #Confirm swap status free -m #This command lists the remaining memory and swap
#Or: sudo swapon -s #This command lists all swap files
#Check disk space
df -h #Create swap file sudo fallocate -l 2G /swapfile #This command will create a 2G swap file
#Change permissions
chmod 600 /swapfile #Convert files to swap mkswap /swapfile #Enable swap swapon /swapfile #Add self start
echo "/swapfile none swap sw 0 0" >> /etc/fstab #Cancel and delete swap (not tested, for reference only)
#Cancel self start vi /etc/fstab #Disable swap swapoff /swapfile #Delete swap
rm -rf /swapfile