Deal with huge files in git

Fix fatal: Out of memory, malloc failed

Posted by on October 15, 2015 Deal with huge files in git

Sometimes you could get issues with allocated memory while commiting any huge file in your git repository. Following error message will printed:

fatal: Out of memory, malloc failed (tried to allocate 1476237742 bytes)

Reason

This means that the delta compression needs more than the allocated memory.

Solution

You could solve this issue with following settings in your local .git/config:

[core]
  packedGitLimit = 128m
  packedGitWindowSize = 128m
  
[pack]
  deltaCacheSize = 128m
  packSizeLimit = 128m
  windowMemory = 128m

Note

Please exetend the `[core]` section in your config instead of duplicate or replace it.

Detailed information could be found here: Better git memory usage settings for huge files