Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I know this has been asked a lot 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

Then I have done small modifications to some files.

When I tried to push it to Github (using my github account)

git add myfile.php
git commit -m "my first commit"
git push origin mybranch

I get this error :

fatal: Out of memory, malloc failed

I don't understand what this mean. The total size of the files I tried to push is 156Ko. Moreover the total size of the project is only 10,9Mo.

I tried to reboot the server but the same happen.

When I run free on the server I get :

             total       used       free     shared    buffers     cached
Mem:        505312     239532     265780          0      51576      71580
-/+ buffers/cache:     116376     388936
Swap:            0          0          0

My coworkers never had this problem before, even on the same test server.

Can someone highlight me on the reason of this error and a possible workaround?
Thanks in advance.

share|improve this question
    
Have you tried changing the settings in .git/config as suggested here? – datUser May 13 '15 at 14:06
    
Yes but no luck... – hg8 May 13 '15 at 14:11
    
Can you try again with the -v flag, git push -v, and post the full error (redacting your repo info of course). – datUser May 13 '15 at 14:24
    
The -v flag does not add anything to the error message... – hg8 May 13 '15 at 14:33
    
This looks like a bug somewhere. What version of Debian does the machine have? Can you reproduce the problem by cloning a local repository rather than one on github? If you can reproduce the problem without using any credentials or private information, run strace -o git.strace -tt git push origin mybranch (or whatever the failing git … command is) and post the resulting git.strace file (don't post the trace if it might contain something like a password). – Gilles May 13 '15 at 22:20
up vote 0 down vote accepted

Turn out it was indeed a ram problem. 268mo was not enough for git to function properly.

I solved the problem by adding 1GO of swap to the server. I hope this might help someone in the future.

Thanks everyone for your help!

share|improve this answer
    
How did you do that, Im getting same issue. – Pramod May 31 '16 at 10:08

I was getting same error as I was running jenkins in docker

I stop container and run git and this fixed the problem

Try to free some more space in RAM

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.