title: Git clone fails with out of memory error - "fatal: out of memory, malloc failed (tried to allocate 905574791 bytes) / fatal: index-pack failed"
body: <p>I'm attempting to clone a large (1.4GB) Git repository to a 32-bit Debian VM with 384MB of RAM. I'm using Git 1.7.2.5, and using the SSH protocol to clone ('git clone user@host.com:/my/repo')</p>
  
  <p>The clone fails with this message:</p>
  
  <pre><code>remote: Counting objects: 18797, done.
  remote: warning: subobtimal pack - out of memory
  remote: Compressing objects: 100% (10363/10363), done.
  fatal: out of memory, malloc failed (tried to allocate 905574791 bytes)
  fatal: index-pack failed
  </code></pre>
  
  <p>I've tried reducing the amount of memory Git uses to repack on the host repository end, and repacking:</p>
  
  <pre><code>git config pack.windowMemory 10m
  git config pack.packSizeLimit 20m
  git repack -a -d
  </code></pre>
  
  <p>My questions are as follows:</p>
  
  <ol>
  <li>Is this a client-size (clone-side) problem or should it be resolved in the repo that I'm cloning from?</li>
  <li><p>In either case, is there anything I can do to make the clone succeed? A lot of the potential solutions online involve some/all of the following things, none of which are acceptable in this instance:</p>
  
  <ul>
  <li>changing the contents of the repository substantively (i.e. deleting large files)</li>
  <li>giving the VM which is doing the clone more RAM</li>
  <li>giving the VM which is doing the clone a 64-bit virtual CPU</li>
  <li>transferring out-of-band (e.g. using Rsync or SFTP to transfer the .git directory)</li>
  </ul></li>
  </ol>
  
  <p>Thanks in advance.</p>