git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* git gc exit with out of memory, malloc failed error
@ 2011-09-15  1:33 Alexander Kostikov
  2011-09-15  2:20 ` David Michael Barr
       [not found] ` <CA+sFfMcfy=GCFrCjonQXvXRQu=hLjDvQViJJ75xqa72Gb23MgQ@mail.gmail.com>
  0 siblings, 2 replies; 5+ messages in thread
From: Alexander Kostikov @ 2011-09-15  1:33 UTC (permalink / raw)
  To: git

I'm new to git and I'm getting the following out of memory error on git gc:

$ git gc
Counting objects: 80818, done.
Delta compression using up to 8 threads.
fatal: Out of memory, malloc failed (tried to allocate 24359675 bytes)
error: failed to run repack

The only advice I found in the internet suggested to run repack with
--window-memory parameter specified. But this call also fails:

$ git repack -adf --window-memory=0
Counting objects: 80818, done.
Delta compression using up to 8 threads.
warning: suboptimal pack - out of memory
fatal: Out of memory, malloc failed (tried to allocate 24356363 bytes)

How do I cleanup my repository?

$ git version
git version 1.7.6.msysgit.0

OS: Windows Server 2008 R2 SP1 (x64)
Physical memory: 24 GB
The commands listed were executed under x64 console process.

-- 
Thanks,
Alexander Kostikov

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: git gc exit with out of memory, malloc failed error
  2011-09-15  1:33 git gc exit with out of memory, malloc failed error Alexander Kostikov
@ 2011-09-15  2:20 ` David Michael Barr
  2011-09-15  2:42   ` Alexander Kostikov
       [not found] ` <CA+sFfMcfy=GCFrCjonQXvXRQu=hLjDvQViJJ75xqa72Gb23MgQ@mail.gmail.com>
  1 sibling, 1 reply; 5+ messages in thread
From: David Michael Barr @ 2011-09-15  2:20 UTC (permalink / raw)
  To: Alexander Kostikov; +Cc: git

On Thu, Sep 15, 2011 at 11:33 AM, Alexander Kostikov
<alex.kostikov@gmail.com> wrote:
> I'm new to git and I'm getting the following out of memory error on git gc:
>
> $ git gc
> Counting objects: 80818, done.
> Delta compression using up to 8 threads.
> fatal: Out of memory, malloc failed (tried to allocate 24359675 bytes)
> error: failed to run repack
>
> The only advice I found in the internet suggested to run repack with
> --window-memory parameter specified. But this call also fails:
>
> $ git repack -adf --window-memory=0
> Counting objects: 80818, done.
> Delta compression using up to 8 threads.
> warning: suboptimal pack - out of memory
> fatal: Out of memory, malloc failed (tried to allocate 24356363 bytes)
>
> How do I cleanup my repository?
>
> $ git version
> git version 1.7.6.msysgit.0
>
> OS: Windows Server 2008 R2 SP1 (x64)
> Physical memory: 24 GB
> The commands listed were executed under x64 console process.
>
> --
> Thanks,
> Alexander Kostikov
> --
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>

Hi,

My understanding is that msysgit is a 32-bit build.
So if your existing pack is ~2GB, repack will fail.
Also, I think that setting window-memory to 0
means no limit, which is not what you want.
One value I have seen suggested is 256m.
In my experience, peak memory consumption of
repack is proportional to the value of --window,
so you might want to try tweaking that.
There are quite a few config parameters that
affect the memory consumption of repack.

-- 
David Barr

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: git gc exit with out of memory, malloc failed error
       [not found] ` <CA+sFfMcfy=GCFrCjonQXvXRQu=hLjDvQViJJ75xqa72Gb23MgQ@mail.gmail.com>
@ 2011-09-15  2:29   ` Brandon Casey
  2011-09-15  9:16     ` Carlos Martín Nieto
  0 siblings, 1 reply; 5+ messages in thread
From: Brandon Casey @ 2011-09-15  2:29 UTC (permalink / raw)
  To: git

[resend since gmail's Rich formatting was enabled]

On Wed, Sep 14, 2011 at 8:33 PM, Alexander Kostikov
<alex.kostikov@gmail.com> wrote:
>
> I'm new to git and I'm getting the following out of memory error on git gc:
>
> $ git gc
> Counting objects: 80818, done.
> Delta compression using up to 8 threads.
> fatal: Out of memory, malloc failed (tried to allocate 24359675 bytes)
> error: failed to run repack

Try reducing the number of threads that are used.  You must have some
pretty large objects if you have 24GB and ran out of memory.  The
following will configure git to use only one thread.
   git config pack.threads=1
-Brandon

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: git gc exit with out of memory, malloc failed error
  2011-09-15  2:20 ` David Michael Barr
@ 2011-09-15  2:42   ` Alexander Kostikov
  0 siblings, 0 replies; 5+ messages in thread
From: Alexander Kostikov @ 2011-09-15  2:42 UTC (permalink / raw)
  To: David Michael Barr; +Cc: git

Thanks!
--window-memory=50m worked for my project. 256m was still throwing
error. Probably real memory consumption is close to threads number *
window memory.


On Wed, Sep 14, 2011 at 7:20 PM, David Michael Barr
<davidbarr@google.com> wrote:
> On Thu, Sep 15, 2011 at 11:33 AM, Alexander Kostikov
> <alex.kostikov@gmail.com> wrote:
>> I'm new to git and I'm getting the following out of memory error on git gc:
>>
>> $ git gc
>> Counting objects: 80818, done.
>> Delta compression using up to 8 threads.
>> fatal: Out of memory, malloc failed (tried to allocate 24359675 bytes)
>> error: failed to run repack
>>
>> The only advice I found in the internet suggested to run repack with
>> --window-memory parameter specified. But this call also fails:
>>
>> $ git repack -adf --window-memory=0
>> Counting objects: 80818, done.
>> Delta compression using up to 8 threads.
>> warning: suboptimal pack - out of memory
>> fatal: Out of memory, malloc failed (tried to allocate 24356363 bytes)
>>
>> How do I cleanup my repository?
>>
>> $ git version
>> git version 1.7.6.msysgit.0
>>
>> OS: Windows Server 2008 R2 SP1 (x64)
>> Physical memory: 24 GB
>> The commands listed were executed under x64 console process.
>>
>> --
>> Thanks,
>> Alexander Kostikov
>> --
>> To unsubscribe from this list: send the line "unsubscribe git" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>>
>
> Hi,
>
> My understanding is that msysgit is a 32-bit build.
> So if your existing pack is ~2GB, repack will fail.
> Also, I think that setting window-memory to 0
> means no limit, which is not what you want.
> One value I have seen suggested is 256m.
> In my experience, peak memory consumption of
> repack is proportional to the value of --window,
> so you might want to try tweaking that.
> There are quite a few config parameters that
> affect the memory consumption of repack.
>
> --
> David Barr
>



--
Your sincerely,
Alexander Kostikov

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: git gc exit with out of memory, malloc failed error
  2011-09-15  2:29   ` Brandon Casey
@ 2011-09-15  9:16     ` Carlos Martín Nieto
  0 siblings, 0 replies; 5+ messages in thread
From: Carlos Martín Nieto @ 2011-09-15  9:16 UTC (permalink / raw)
  To: Brandon Casey; +Cc: git, Alexander Kostikov

[-- Attachment #1: Type: text/plain, Size: 994 bytes --]

On Wed, 2011-09-14 at 21:29 -0500, Brandon Casey wrote:
> [resend since gmail's Rich formatting was enabled]
> 
> On Wed, Sep 14, 2011 at 8:33 PM, Alexander Kostikov
> <alex.kostikov@gmail.com> wrote:
> >
> > I'm new to git and I'm getting the following out of memory error on git gc:
> >
> > $ git gc
> > Counting objects: 80818, done.
> > Delta compression using up to 8 threads.
> > fatal: Out of memory, malloc failed (tried to allocate 24359675 bytes)
> > error: failed to run repack
> 
> Try reducing the number of threads that are used.  You must have some
> pretty large objects if you have 24GB and ran out of memory.  The

IIRC the 32-bit Windows builds limit each user process to 2GB. If
msysgit is built in 32-bit mode, it's possible (probable even, in order
to remain backwards-compatible) that it's hitting this limit, rather
than the physical limit of the machine. If it's using 8 threads, it
means that there are 256MB available for each thread.

   cmn

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 490 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-09-15  9:16 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-09-15  1:33 git gc exit with out of memory, malloc failed error Alexander Kostikov
2011-09-15  2:20 ` David Michael Barr
2011-09-15  2:42   ` Alexander Kostikov
     [not found] ` <CA+sFfMcfy=GCFrCjonQXvXRQu=hLjDvQViJJ75xqa72Gb23MgQ@mail.gmail.com>
2011-09-15  2:29   ` Brandon Casey
2011-09-15  9:16     ` Carlos Martín Nieto

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).