I have this error while pushing my project to tfs GIT.
fatal: Out of memory, malloc failed (tried to allocate 889192448 bytes)
I fixed this by decreasing the postbuffer
size:
[http]
postbuffer = 5m
Edit .git/config
on Unix or .gitconfig
on Windows and modifiy the following params. By running git config --list --show-origin
you could locate your gitconfigs.
[core]
packedGitLimit = 128m
packedGitWindowSize = 128m
[pack]
deltaCacheSize = 128m
packSizeLimit = 128m
windowMemory = 128m
[http]
postbuffer = 5m
If you are using git via CLI ensure you restart your shell/terminal after you changed this settings.
So what it basically requires is the free memory of 889192448 bytes (889MB Approx). This error occurs for 2 reasons
To check the free memory on Linux based systems.
free -h
If free memory is greater than the required memory, then you don't have to do anything here, otherwise you need to add the swap memory to increase the available free space on RAM.
If the free memory of RAM is already in place for the required memory, then you need to configure your git to utilise this. You do this with the following:
git config pack.packSizeLimit 1g
git config pack.deltaCacheSize 1g
git config pack.windowMemory 1g
git config core.packedGitLimit 1g
git config core.packedGitWindowSize 1g
Hope this helps.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With