Git克隆失败,内存不足错误 - “致命:内存不足,malloc失败(试图分配905574791字节)/致命:索引包失败” [英] Git clone fails with out of memory error - "fatal: out of memory, malloc failed (tried to allocate 905574791 bytes) / fatal: index-pack failed"

查看:1766
本文介绍了Git克隆失败,内存不足错误 - “致命:内存不足,malloc失败(试图分配905574791字节)/致命:索引包失败”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图将一个大的(1.4GB)Git存储库克隆到具有384MB RAM的32位Debian VM。我使用Git 1.7.2.5,并使用SSH协议克隆('git clone user@host.com:/ my / repo')



克隆失败使用以下消息:

  remote:计数对象:18797,完成。 
remote:warning:subobtimal pack - 内存不足
remote:压缩对象:100%(10363/10363),完成。
致命:内存不足,malloc失败(尝试分配905574791字节)
致命:索引包失败

我已经尝试减少Git在主机版本库中重新使用的内存量,并重新打包:

  git config pack.windowMemory 10m 
git config pack.packSizeLimit 20m
git repack -a -d

我的问题如下:


  1. 这是一个客户端大小(克隆方)的问题,在我从克隆的回购中应该解决吗?

  2. 在任一种情况下,是否有任何可以使克隆成功的东西?许多潜在的在线解决方案涉及以下一些或全部以下事项,在这种情况下,这些都不可接受:




    • 更改内容(即删除大文件)

    • 给正在执行克隆的虚拟机更多的RAM

    • 给出正在执行克隆的虚拟机传输带外的64位虚拟CPU

    • (例如使用Rsync或SFTP传输.git目录)

提前感谢

解决方案

git clone 不会看你的 pack.packSizeLimit 设置,它将无论如何将一切都转移到一个包中 - 除非从上次我看起来,它改变了。



使用SCP或Rsync可能是解决您的问题的一种方式。删除无用的大文件,然后重新打包您尝试克隆的存储库也可以帮助。



给VM提供更多的RAM也可能有帮助 - 我不认为您将需要一个64位地址空间来分配900MB ...您还可以给它足够的SWAP空间来处理900MB的程序包,而不是增加RAM。


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')

The clone fails with this message:

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

I've tried reducing the amount of memory Git uses to repack on the host repository end, and repacking:

git config pack.windowMemory 10m
git config pack.packSizeLimit 20m
git repack -a -d

My questions are as follows:

  1. Is this a client-size (clone-side) problem or should it be resolved in the repo that I'm cloning from?
  2. 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:

    • changing the contents of the repository substantively (i.e. deleting large files)
    • giving the VM which is doing the clone more RAM
    • giving the VM which is doing the clone a 64-bit virtual CPU
    • transferring out-of-band (e.g. using Rsync or SFTP to transfer the .git directory)

Thanks in advance.

解决方案

git clone will not look at your pack.packSizeLimit setting, it'll anyway transfer everything in a single pack - unless it changed since the last time I looked.

Using SCP or Rsync might be a way to work around your issue indeed. Removing the "useless" large files, then repacking the repository you try to clone could also help.

Giving more RAM to the VM might also help - I don't think you'll need a 64-bits address space to allocate 900MB... You could also give it enough SWAP space to handle the 900MB package instead of increasing the RAM.

这篇关于Git克隆失败,内存不足错误 - “致命:内存不足,malloc失败(试图分配905574791字节)/致命:索引包失败”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆