Gmane
From: Linus Torvalds <torvalds <at> linux-foundation.org>
Subject: RE: [BUG] malloc error when using large file.
Newsgroups: gmane.comp.version-control.git
Date: 2009-06-23 21:15:21 GMT (37 weeks, 1 day, 3 hours and 10 minutes ago)

On Tue, 23 Jun 2009, Emmanuel Puerto wrote:
> 
> 
> > Many operations in git assume that a whole file can be held in memory at
> > once. Do you actually have 2G available on the machine? Are there any OS
> > limits that might be a problem?
> 
> Thanks for your answer Jeff, 
> 
> Yes I have more that 2 Go available when a do it, and after this 
> allocation error if I try to do a 'git add' with a 9Go file, I did not 
> have any issue.

Can you add the 2GB files individually, using

	for i in All-f00?.vmdk; do git add $i; done

or similar?

It does sound like an unlucky malloc VM space fragmentation issue, 
although since the files you add are the same size I'd have not really 
expected that with any normal malloc library. But with some mixed small 
and large allocations, I could imagine that the fragmentation happens, and 
you end up having huge areas that aren't _quite_ useful for the next file 
due to having some small allocation taking part of it.

		Linus