git add error : “fatal : malloc, out of memory”

2019-07-15 13:40发布

问题:

When i attempt to do a git add i get the error "fatal : malloc, out of memory". i imagine the system has ran out of memory obviously but is there a way to get around this.

Also i am running windows server 2003 and using msysGit.

EDIT: After more searching around i think its a problem with the packing of git, apparently their compression method is great for small files but on big files it chokes hard.

回答1:

After much research i found its a simple problem of the packer running out of memory, this is due to the fact that git uses compression methods that are more suitable to large amounts of small files.

If any was interested i am getting around this problem by splitting the files before add them in so it can still track the changes but it will need to be put together when getting it back.



回答2:

I increased the memory on my server and it solved the problem.