title: Git push - Out of memory, calloc failed and pack-objects died with strange error
body: <p>I'm having this problem while trying to push my repo to bitbucket for the first time:</p>
  
  <pre><code>[~/public_html]# git push -u origin --all
  Counting objects: 2170, done.
  Delta compression using up to 12 threads.
  fatal: Out of memory, calloc failed  
  error: pack-objects died with strange error
  </code></pre>
  
  <p>I've found similar propblems on StackOverflow that suggest using repack with --window-memory and --max-pack-size, but I get pretty much the same error:</p>
  
  <pre><code>[~/public_html]# git repack -a -d --window-memory 10m --max-pack-size 10m
  Counting objects: 2170, done.
  Delta compression using up to 12 threads.
  fatal: Out of memory, calloc failed
  </code></pre>
  
  <p>My server has 4 GB of memory, so I can't see how it's run out. I don't have any particulary large files and my entire repo is only 12 MB</p>
  
  <p>I have already done some searching, but I can't find anything particular to my case.</p>
  
  <p>What could be happening here?</p>