Probably because Gitlab can't allocate enough memory,
You need to create a swap file. Try the following steps to see if this works:
#dd if=/dev/zero of=/swapfile bs=2048k count=1000
#mkswap /swapfile
#swapon /swapfile
#swapon -s
#chown root:root /swapfile
#chmod 0600 /swapfile
#echo 10 | sudo tee /proc/sys/vm/swappiness
#echo vm.swappiness = 10 | sudo tee -a /etc/sysctl.conf
If this works you can make it permanent by editing the following file: #nano /etc/fstab
add this line :
/swapfile none swap sw 0 0
Hope this helps