title: git push Out of memory, malloc failed
body: <p>I am trying to push my changes remotely to GitHub, every so often <strong><em>git</em></strong> fails due to </p>
  
  <pre><code>C:\dev\projects&gt;git push -v
  Pushing to https://user@github.com/mycompany/My-Project.git
  Password for 'github.com':
  fatal: Out of memory, malloc failed (tried to allocate 524288000 bytes)
  fatal: write error: Invalid argument
  </code></pre>
  
  <p>This is very, very aggravating.  I have run the following commands, upgraded <strong><em>git</em></strong> (which wiped out my settings and caused lots of pain, but I digress)</p>
  
  <pre><code>git gc --auto --prune=today --aggressive
  git repack
  </code></pre>
  
  <p>I have even bumped the value of</p>
  
  <pre><code>http.postbuffer
  </code></pre>
  
  <p>but eventually it will fail again.</p>
  
  <p>This is a typical Rails 3.1 application, total project size on disk is 9.69 MB.</p>