Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.2k views
in Technique[技术] by (71.8m points)

git - Error when pulling warning: suboptimal pack - out of memory

I keep getting this error when trying to do a git?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?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...