git fatal: Out of memory, malloc failed

发布于 2018-12-04 05:11:19

解决方法参考来源stackoverflow

Their "faster" way:

sudo fallocate -l 4G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile

You can make these changes permanent by adding to /etc/fstab: /swapfile none swap sw 0 0

echo "/swapfile none swap sw 0 0" >>/etc/fstab

They recommend adding to /etc/sysctl.conf:

vm.swappiness=10
vm.vfs_cache_pressure = 50