我正在尝试将一个大的(1.4GB) Git存储库克隆到一个32位的Debian上,这个虚拟机有384 of的RAM。我使用Git 1.7.2.5,并使用SSH协议克隆('git克隆用户@host.com:/my/repo‘)
克隆失败的消息如下:
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我尝试减少Git用于在主机存储库端重新打包的内存量,并重新打包:
git config pack.windowMemory 10m
git config pack.packSizeLimit 20m
git repack -a -d我的问题如下:
- 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)
提前谢谢。
发布于 2011-09-30 08:54:59
git clone不会查看您的pack.packSizeLimit设置,它无论如何都会在一个包中传输所有内容--除非它自我上次查看以来就已经改变了。
使用SCP或Rsync可能确实是解决问题的一种方法。删除“无用”的大型文件,然后重新打包您试图克隆的存储库也会有所帮助。
向VM提供更多的RAM也可能有帮助--我不认为您需要64位地址空间来分配900 to .您还可以给它足够的交换空间来处理900 of包,而不是增加RAM。
发布于 2013-08-29 16:22:18
我在使用MSysGit 32位的Windows上也遇到了类似的问题。来自西格温的git 64位完成了这项工作。也许您应该使用64位Debian (而不是32位)。
我的原始答案可以在Windows上的Git,“内存不足- malloc失败”问题上使用。
发布于 2017-04-25 08:37:14
今天我也遇到了同样的问题。Git服务器内存不足,但gitlab报告说内存仍然可用。我们用htop检查内存(报告没有可用),重新启动gitlab,一切都恢复正常。
https://stackoverflow.com/questions/7607970
复制相似问题