git fatal out of memory malloc failed fix with git-repack

Date: Sun, 15 Nov 2009 14:44:29 +0000 (UTC)
From:Alejandro Riveira <ariveira@xxxxxxxxx>
Subject:Re: git gc - out of memory
url:http://lists-archives.org/git/705379-git-gc-out-of-memory.html

El Sat, 14 Nov 2009 20:26:00 +0100, Simon Strandgaard escribió:

> My bare repository is on an OpenBSD machine. I was unaware of the
> importance of git gc until today after investigating a problem with "git
> pull". So there hasn't been run git gc on the repository ever.
>
> The biggest file in the repository is a 45 mb file. The repository size
> is near 2 gb.
>
> What can I do?

run git repack -adf --window=memory on the repo where memory is escaled apropiately for your machine ?

See git help repack

Regards;

  • Date: Sun, 15 Nov 2009 19:33:27 +0100
  • From: Simon Strandgaard <neoneye@xxxxxxxxx>
  • Subject: Re: git gc - out of memory

Thank you Alejandro, it now works!

I think the default is 10, so I tried with window=5 and it completed a full repack:

$ git repack -adf --window=5
Counting objects: 5934, done.
Compressing objects: 100% (5711/5711), done.
Writing objects: 100% (5934/5934), done.
Total 5934 (delta 3733), reused 0 (delta 0)
Removing duplicate objects: 100% (256/256), done.

$ git gc
Counting objects: 5934, done.
Compressing objects: 100% (1978/1978), done.
Writing objects: 100% (5934/5934), done.
Total 5934 (delta 3733), reused 5934 (delta 3733)

Now that it works.. Should I report the original issue as a bug somewhere? e.g. malloc failed sounds like a bug.