The error should be probably with cloning the git and not with the client software. Have you tried increasing the size of postbuffer? You can do that by typing the following in terminal
git config --global --edit
If the issue still persist, then some possible solutions might be
1. The error should be with the memory allocation for git by your PC. Try changing the memory allocation in the git config file.
2. Firewall may be blocking the cloning process . Disable the firewall few minutes and try cloning it again.
3. The bitcoin repo is too big, so try cloning them separately.