I know this has been asked a lot on StackOverflow but I did not manage to get any solution to solve my problem.
My coworker assigned me on a new project. The application is hosted on test Debian server with git installed.
First I have created my branch :
git checkout -b mybranch
git add myfile.php
git commit -m "my first commit"
git push origin mybranch
fatal: Out of memory, malloc failed
total used free shared buffers cached
Mem: 505312 239532 265780 0 51576 71580
-/+ buffers/cache: 116376 388936
Swap: 0 0 0
From the error message, it's not clear to me whether the error is on the local or the remote side.
Since it works for you coworker, the problem is probably on your computer. Maybe the Git repo is damaged. Try check it with
You can also clone the remote repo a second time as
/tmp/test1 and then try
git push /tmp/test1. If this works, the problem is remote. If it fails, there is something wrong on your PC.
On your PC, check that you have enough memory free and how much memory a single process can request. On Linux, use
ulimit -a for this.
[EDIT] Also the output of
free suggests that you only have 256MB of free memory (you can verify with
free -h to more readable numbers). That's barely enough to run most programs today. Git needs a lot of memory to do its magic, so yes, you might actually have too little memory free.