git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: GIT max file size.

From
Linus Torvalds <torvalds@linux-foundation.org>
Date
May 8, 2008, 20:46 UTC
Message-ID
<alpine.LFD.1.10.0805081334530.2940@woody.linux-foundation.org>
In-Reply-To
<48232B48.9010900@cc.hut.fi>
On Thu, 8 May 2008, epankala@cc.hut.fi wrote:
> 
> I received "fatal: Out of memory, malloc failed" error when I tried to
> check in file of ~2.5G
There's two issues there.

One is that a lot of what git does is simply "whole file at a time". The diff machinery, and a lot of the core stuff, simply just expects to be able to mmap() or read the whole file in one go. So on a 32-bit architecture, you'll generally be limited to the size of the address space, not to anything else.

The other thing is then that (partly because of the above) there probably are places where we haven't been as careful about size-type things as we could have been. A lot of the code uses size_t, but I bet not everything does.

		Linus
Previous: Alex Riesen
Message 3 of 3 in “GIT max file size.”
  1. epankala@cc.hut.fiMay 8, 2008
  2. Alex RiesenMay 8, 2008
  3. Linus TorvaldsMay 8, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.