Windows上的Git,“内存不足-malloc失败”

遇到了存储库问题,并尝试了几乎所有可能的配置设置,例如。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

尝试了git gc和git repack的各种选项,但始终返回相同的错误。


几乎放弃了,即将创建一个新的仓库,但我想先问一下:)


天涯尽头无女友
浏览 1631回答 3
3回答

湖上湖

我在这里找到了对我有用的解决方案。在.git / config文件(客户端和/或服务器)中,我添加了以下内容:[core]  packedGitLimit = 128m  packedGitWindowSize = 128m[pack]  deltaCacheSize = 128m  packSizeLimit = 128m  windowMemory = 128m

UYOU

自git-v2.5.0 (2015年8月)以来,git-for-windows(以前为MSysGit)      提供了Pan.student注意到的64位版本。       在此答案中,我建议安装Cygwin 64位(提供64位Git版本)。达到4GB的限制时,我Out of memory, malloc failed使用MSysGit遇到了类似的问题:> git --versiongit version 1.8.3.msysgit.0> file path/Git/cmd/gitpath/Git/cmd/git: PE32 executable for MS Windows (console) Intel 80386 32-bit> time git clone --bare -v ssh://linuxhost/path/repo.gitCloning 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 objectsreal    13m8.901suser    0m0.000ssys     0m0.015sMSysGit达到4 GB屏障后崩溃最后来自Cygwin的 git 64位修复了它:> git --versiongit 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.gitCloning 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.451suser    3m2.488ssys     3m53.234s来自Cygwin的git 64位成功仅供参考linuxhost:64位:repo.git> git config -luser.email=name@company.comcore.repositoryformatversion=0core.filemode=truecore.bare=truerepo.git> git --versiongit version 1.8.3.4repo.git> uname -aLinux 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
打开App,查看更多内容
随时随地看视频慕课网APP