且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

提醒警告时出错:次优包装 - 内存不足

更新时间:2023-11-13 14:28:34

此主题建议


运行« git repack -adf --window = memory »在存储器适当升级为您的机器的情况下。


与SO问题相比,这几乎是相同的解决方案重新包装Git存储库失败。

  git repack -a -d --window-memory 10m --max-pack-size 20m 

然而, Mark Longair 将会向您发出警告


您的解决方案为您提供了本地和远程的工作副本,但当远程回购时会再次出现问题

因此,配置 pack.windowMemory pack.packSizeLimit 是一个更安全的解决方案,同时检查 core.packedxxx core.deltaxxx



对于Windows上的msysgit,此评论提到:

  git config --global pack.windowMemory 256m 




为我工作

(在64位窗口上有内存分配错误(Git-1.7.6-preview20110708.exe))



I keep getting this error when trying to do a pull or a git gc

warning: suboptimal pack - out of memory Compressing objects: 100% (10955/10955), done. fatal: Out of memory, malloc failed (tried to allocate 827101023 bytes) error: failed to run repack

How would I go about fixing this?

This thread suggests

run « git repack -adf --window=memory » on the repo where memory is escalated appropriately for your machine.

That is pretty much the same solution than for the SO question "Repack of Git repository fails".

git repack -a -d --window-memory 10m --max-pack-size 20m

However, Mark Longair will 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.

So configuring pack.windowMemory and pack.packSizeLimit is a much safer solution, as well as checking the config of core.packedxxx and core.deltaxxx.

For msysgit on Windows, this comment mentions:

git config --global pack.windowMemory 256m

worked for me
(had have memory alloc error on 64 bit windows (Git-1.7.6-preview20110708.exe)