服务器上有一个git仓库,这个仓库里面全是tarball源码文件,里面是一些知名的开源软件的源码压缩包,比如内核等。总大小在600M左右。
服务器是买的阿里云的512M,配置最低的服务器。当在本地进行git clone的时候出错了。
yuan@yuan-vm:~$ git clone ssh://root@insidelinuxdev.net/work/git/Xrouter-tarballs tarballs
Cloning into 'tarballs'...
root@insidelinuxdev.net's password:
remote: Counting objects: 75, done.
error: pack-objects died of signal 9/75)
error: git upload-pack: git-pack-objects died with error.
fatal: git upload-pack: aborting due to possible repository corruption on the remote side.
remote: aborting due to possible repository corruption on the remote side.
fatal: early EOF
fatal: index-pack failed
在服务器通过demsg查看日志,出现了oom。应该是git pack object的时候,内存耗尽了。搜索后,修改下述配置,可以解决问题:
git config --global core.bigFileThreshold 2m
设置大于2m的文件不压缩。
设置下面这个选项没用:
git config --global core.packedGitWindowSize 4m
git config --global core.packedGitLimit 64m 参考:
https://serverfault.com/questions/372899/git-fails-to-push-with-error-out-of-memory
https://git-scm.com/docs/git-config