Error when pulling warning: suboptimal pack – out of memory

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

  • Xcode 7 GM can not authenticate git repository
  • Git branching strategy for a newly lean team
  • Git: How to store 'git stash' Data
  • git: replace folder with the same folder on a different branch
  • Using git for version control
  • Bower - Give different path to a registered package
  • How would I go about fixing this?

  • Difference between 'rebase master' and 'rebase --onto master' from a branch derived from a branch of master
  • How to correctly develop within a feature branch that spans months
  • Share unfinished work (uncommited and new files) via Git
  • Trying to commit to GitHub using powershell results in error “fatal: unable to access 'Microsoft.PowerShell.Core\FileSystem”
  • Sourcetree 1.5.2 update for Windows not tracking local changes
  • git - Your branch is ahead of 'origin/master' by 1 commit
  • 2 Solutions collect form web for “Error when pulling warning: suboptimal pack – out of memory”

    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)

    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.

    Git Baby is a git and github fan, let's start git clone.