I can't backup my website on a shared server because memory runs out. What can I do?
According to this tutorial hostgator shared hosts can get ssh access so 2 of the solutions below assume ssh access ha been setup properly (the setup of ssh is beyond the scope of these forums)

This is also a general solution as most shared hosts nowadays have ssh access

1. using command line

# go to root directory
cd httpdocs

# dump database
mysqldump -u USERNAME -p'PASSWORD' DATABASENAME &gt; database.sql

# zip the whole drupal directory
zip -9 -qr html.zip .


2. Using drush

setup drush (done once)

# get drush
wget http://files.drush.org/drush.phar;
# if above does not work go to and get the link to latest version .phar from
# https://github.com/drush-ops/drush/releases
# wget https://github.com/drush-ops/drush/releases/download/8.1.16/drush.phar

# make it executable
chmod +x drush.phar;

# move it to home directory or any other directory
mv drush.phar ~/drush;

# go to that directory
cd ~

# find out the path to the directory
pwd
# the output would look similar to this
# /home/your_user

# edit the following file 
nano .bashrc
# or 
# nano .bash_profile

# add this the end of the file
alias drush='/home/your_user/drush';

# use the alias you just setup
source ~/.bashrc;


using drush 

# after setting up drush 
# go to root directory
cd httpdocs
# dump the database
drush sql-dump &gt; database.sql
# zip the whole drupal directory
zip -9 -qr html.zip .


3. if no ssh present you will need to use cpanel, plesk or another control panel

database backup (one of the following)


go into cpanel and find phpmyadmin go into your database and start the export process
some panels will have under databases a way to backup a database without getting into phpmyadmin


files backup


go into file manager and find the root directory (public_html or httpdocs) and zip the folder


Notes

More on drupal backup  

If memory runs out on any of the previous solutions perhaps you ought to upgrade your plan or move to a vps/dedicated/cloud hosting solution

if none of the above works and the support is not willing to help you set a way to backup your site get out of that host they are not worth the money that you spend