Solve the error: fatal: Out of memory, malloc failed

When using a cloud server git clone a project, I encountered the following problem:

fatal: Out of memory, malloc failed (tried to allocate 2000000000 bytes)

Baidu Once you find the following solution:

sudo mkdir -p /opt/temp
sudo dd if=/dev/zero of=/opt/temp/swapfile bs=1M count=1024
sudo chmod 600 /opt/temp/swapfile
sudo mkswap /opt/temp/swapfile
sudo swapon /opt/temp/swapfile

 

Guess you like

Origin www.cnblogs.com/kaymi/p/11414002.html