我试图做一个pull或git gc时一直遇到这个错误
警告:次优包装 – 内存不足
压缩对象:100%(10955/10955),完成.
致命:内存不足,malloc失败(试图分配827101023字节)
错误:无法运行重新包装
我该如何解决这个问题?
解决方法
This thread建议
run «
git repack -adf --window=memory
» on the repo where memory is escalated appropriately for your machine.
这与SO问题“Repack of Git repository fails”几乎完全相同.
git repack -a -d --window-memory 10m --max-pack-size 20m
但是,Mark Longair将于warn you that:
Your solution has got you a working copy locally and remotely,but will cause problems again when the remote repository decides to repack itself again.
因此,配置pack.windowMemory和pack.packSizeLimit是一个更安全的解决方案,以及检查core.packedxxx和core.deltaxxx的配置.
对于Windows上的msysgit,此评论提到:
git config --global pack.windowMemory 256m
worked for me (had have memory alloc error on 64 bit windows (Git-1.7.6-preview20110708.exe)