遇到了存储库的问题,并尝试了几乎所有可能的配置设置,例如.pack.WindowMemory等等
我相信有人已经检查了一个大文件到远程存储库,现在每次我尝试拉动或推送它时,GIT会尝试打包它并耗尽内存:
Auto packing the repository for optimum performance. You may also
run "git gc" manually. See "git help gc" for more information.
Counting objects: 6279, done.
Compressing objects: 100% (6147/6147), done.
fatal: Out of memory, malloc failed (tried to allocate 1549040327 bytes)
error: failed to run repack
Run Code Online (Sandbox Code Playgroud)
尝试过各种选项的git gc&git repack,但仍然返回相同的错误.
几乎放弃了,即将创建一个新的回购,但我想先问一下:)
小智 101
我找到了一个解决方案,这对我有用.
在.git/config文件(客户端和/或服务器)中,我添加了以下内容:
[core]
packedGitLimit = 128m
packedGitWindowSize = 128m
[pack]
deltaCacheSize = 128m
packSizeLimit = 128m
windowMemory = 128m
Run Code Online (Sandbox Code Playgroud)
Von*_*onC 18
作为参考(您可能已经看过它),处理该问题的msysgit案例是票证292.
它提出了几个解决方法:
pack.window为0.当然,这将使光盘上的存储库大得多.delta上的标志.gitattributesgit config --global pack.threads 1git config --global pack.windowMemory 256m(你已经尝试过那个,但也在" 拉动警告时出错:次优包装 - 内存不足 "中进行了说明)pack相关的.要禁用某些文件的增量压缩
.git/info/attributes,请添加:
*.zip binary -delta
Run Code Online (Sandbox Code Playgroud)
对于属性
delta设置为false的路径,不会尝试对blob进行增量压缩.
也许更简单的解决方法是在大文件提交之前以某种方式重置历史记录,并从那里重做其他提交.
oli*_*bre 14
编辑:自git-v2.5.0 (2015年8月)以来,git-for-windows(以前称为MSysGit)
提供64位版本,如Pan.student所注意到的.
在这个答案中,我建议安装Cygwin 64位(提供64位Git版本).
当达到4GB屏障时,我Out of memory, malloc failed使用MSysGit遇到了类似的问题:
> git --version
git version 1.8.3.msysgit.0
> file path/Git/cmd/git
path/Git/cmd/git: PE32 executable for MS Windows (console) Intel 80386 32-bit
> time git clone --bare -v ssh://linuxhost/path/repo.git
Cloning into bare repository 'repo.git'...
remote: Counting objects: 1664490, done.
remote: Compressing objects: 100% (384843/384843), done.
remote: Total 1664490 (delta 1029586), reused 1664490 (delta 1029586)
Receiving objects: 100% (1664490/1664490), 550.96 MiB | 1.55 MiB/s, done.
Resolving deltas: 100% (1029586/1029586), done.
fatal: Out of memory, malloc failed (tried to allocate 4691583 bytes)
fatal: remote did not send all necessary objects
real 13m8.901s
user 0m0.000s
sys 0m0.015s
Run Code Online (Sandbox Code Playgroud)

最后来自Cygwin的 git 64位修复它:
> git --version
git version 1.7.9
> file /usr/bin/git
/usr/bin/git: PE32+ executable (console) x86-64 (stripped to external PDB), for MS Windows
> time git clone --bare -v ssh://linuxhost/path/repo.git
Cloning into bare repository 'repo.git'...
remote: Counting objects: 1664490, done.
remote: Compressing objects: 100% (384843/384843), done.
remote: Total 1664490 (delta 1029586), reused 1664490 (delta 1029586)
Receiving objects: 100% (1664490/1664490), 550.96 MiB | 9.19 MiB/s, done.
Resolving deltas: 100% (1029586/1029586), done.
real 13m9.451s
user 3m2.488s
sys 3m53.234s
Run Code Online (Sandbox Code Playgroud)

linuxhost64位的FYI :
repo.git> git config -l
user.email=name@company.com
core.repositoryformatversion=0
core.filemode=true
core.bare=true
repo.git> git --version
git version 1.8.3.4
repo.git> uname -a
Linux linuxhost 2.6.32-279.19.1.el6.x86_64 #1 SMP Sat Nov 24 14:35:28 EST 2012 x86_64 x86_64 x86_64 GNU/Linux
Run Code Online (Sandbox Code Playgroud)
如果我的回答无法解决您的问题,您也可以查看以下页面:
| 归档时间: |
|
| 查看次数: |
73013 次 |
| 最近记录: |