git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* how to keep git-fetch from running out of memory?
@ 2011-05-15  5:24 Kartik Agaram
  2011-05-15 19:13 ` Shawn Pearce
  0 siblings, 1 reply; 4+ messages in thread
From: Kartik Agaram @ 2011-05-15  5:24 UTC (permalink / raw)
  To: git

I have a git repo with some large files that I'm no longer able to
update. git fetch keeps running out of memory:

  fatal: Out of memory, malloc failed
  fatal: unpack-objects died with error code 128

Anybody know how to keep it from compressing the refs into packfiles?
I've experimented with core.compression, pack.compression,
pack.windowMemory, pack.packSizeLimit, all without luck :(

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

* Re: how to keep git-fetch from running out of memory?
  2011-05-15  5:24 how to keep git-fetch from running out of memory? Kartik Agaram
@ 2011-05-15 19:13 ` Shawn Pearce
  2011-05-15 20:25   ` Junio C Hamano
  0 siblings, 1 reply; 4+ messages in thread
From: Shawn Pearce @ 2011-05-15 19:13 UTC (permalink / raw)
  To: Kartik Agaram; +Cc: git

On Sat, May 14, 2011 at 22:24, Kartik Agaram <ak@akkartik.com> wrote:
> I have a git repo with some large files that I'm no longer able to
> update. git fetch keeps running out of memory:
>
>  fatal: Out of memory, malloc failed
>  fatal: unpack-objects died with error code 128
>
> Anybody know how to keep it from compressing the refs into packfiles?
> I've experimented with core.compression, pack.compression,
> pack.windowMemory, pack.packSizeLimit, all without luck :(

Instead of playing with these settings, try transfer.unpackLimit 1. It
will force the code to use index-pack rather than unpack-objects,
which has a different memory profile.

However, that may still be insufficient. A big object must still be
allocated in memory in order to compute its SHA-1. If you don't have
sufficient memory, you need to increase your ulimits, or reconfigure
your system to have more virtual memory available to the process.

-- 
Shawn.

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

* Re: how to keep git-fetch from running out of memory?
  2011-05-15 19:13 ` Shawn Pearce
@ 2011-05-15 20:25   ` Junio C Hamano
  2011-05-15 20:37     ` Shawn Pearce
  0 siblings, 1 reply; 4+ messages in thread
From: Junio C Hamano @ 2011-05-15 20:25 UTC (permalink / raw)
  To: Shawn Pearce; +Cc: Kartik Agaram, git

Shawn Pearce <spearce@spearce.org> writes:

> However, that may still be insufficient. A big object must still be
> allocated in memory in order to compute its SHA-1.

I wonder if we can stream this?

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

* Re: how to keep git-fetch from running out of memory?
  2011-05-15 20:25   ` Junio C Hamano
@ 2011-05-15 20:37     ` Shawn Pearce
  0 siblings, 0 replies; 4+ messages in thread
From: Shawn Pearce @ 2011-05-15 20:37 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Kartik Agaram, git

On Sun, May 15, 2011 at 13:25, Junio C Hamano <gitster@pobox.com> wrote:
> Shawn Pearce <spearce@spearce.org> writes:
>
>> However, that may still be insufficient. A big object must still be
>> allocated in memory in order to compute its SHA-1.
>
> I wonder if we can stream this?

If its a non-delta, yes. We already do this in JGit for blobs over
50M. (Trees, commits and tags are not streamed because we might need
to do fsck on them and the fsck code for these object types requires
the entire object in a single buffer.)

Its probably not a huge change to index-pack.c. But I haven't dug
around in there in a while. I wish I could say I will look at this on
Monday, but I don't have the time.

-- 
Shawn.

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

end of thread, other threads:[~2011-05-15 20:37 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-15  5:24 how to keep git-fetch from running out of memory? Kartik Agaram
2011-05-15 19:13 ` Shawn Pearce
2011-05-15 20:25   ` Junio C Hamano
2011-05-15 20:37     ` Shawn Pearce

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).