Error when pulling warning: suboptimal pack - out of memory
Asked Answered
E

2

10

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?

Esthonia answered 27/1, 2012 at 21:7 Comment(0)
R
19

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)

Reliance answered 27/1, 2012 at 23:42 Comment(0)
A
-1

Running

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

did not really solve my problem.

Removing the repository and then git cloning again solved the problem.

Achromic answered 1/3, 2014 at 17:56 Comment(1)
I am getting this when trying to pull just before pushing back to the remote. Removing the repository and cloning again would undo my commits.Crusty

© 2022 - 2024 — McMap. All rights reserved.