2013-12-18 47 views
4
  1. 首先,我做的事:混帐子模块更新--init
 
    Cloning into '_aaa'... 
    Checking connectivity... done. 
    Submodule path '_aaa': checked out '87311dd0bb0ac9b77cd9bbac0a15671858f0cf17' 
  1. ,则:混帐取--recurse-子模块
 
    Fetching submodule _base 
    Fetching submodule _aaa 
    Auto packing the repository for optimum performance. You may also 
    run "git gc" manually. See "git help gc" for more information. 
    Counting objects: 21678, done. 
    Compressing objects: 100% (20602/20602), done. 
    Writing objects: 100% (21678/21678), done. 
    Total 21678 (delta 8973), reused 0 (delta 0) 
    Removing duplicate objects: 100% (256/256), done. 
    fatal: Out of memory? mmap failed: Cannot allocate memory 
    fatal: Out of memory? mmap failed: Cannot allocate memory 
    error: failed to run prune 

最近的更新是相当大的1GB左右,但没有超过40MB的文件。混帐获取:无法分配内存

我在服务器上的内存量从512M增加到1024M,但问题仍然存在。我也尝试了与git gc,window,compress等不同的游戏,没有任何结果。

+0

作为一个替代的解决方案,你可以取一个子模块在同一时间,而不是使用'--recurse-submodules' – rednaw

+0

我已经尝试过了,得到了同样的错误。 – user1934268

+0

你看过这个问题吗? http://stackoverflow.com/q/6775242/1248175 – rednaw

回答

3

该错误本身来自git的sha1对象处理代码,但很难说没有发生什么事情,也不知道mmap返回的errno是什么。

你可以在strace下运行你的命令,并在这里发布mmap失败的命令吗?

编辑:尝试git config --add core.bigFileThreshold 4m(或甚至可能更少)。

core.bigFileThreshold 

    Files larger than this size are stored deflated, without attempting delta compression. Storing large files without delta compression avoids excessive memory usage, at the slight expense of increased disk usage. 

    Default is 512 MiB on all platforms. This should be reasonable for most projects as source code and other text files can still be delta compressed, but larger binary media files won’t be. 

    Common unit suffixes of k, m, or g are supported. 

https://www.kernel.org/pub/software/scm/git/docs/git-config.html

+0

这里是第一笔收入

 ... [pid 23816] fcntl(3, F_SETFD, FD_CLOEXEC) = 0 [pid 23816] read(3, "PACK\0\0\0\2\0\0T\256", 12) = 12 [pid 23816] lseek(3, 918541449, SEEK_SET) = 918541449 [pid 23816] read(3, "n\373\t\n\341\330Tf\253\372\263/\211e%\f8\5Y(", 20) = 20 [pid 23816] mmap(NULL, 918541469, PROT_READ, MAP_PRIVATE, 3, 0) = -1 ENOMEM (Cannot allocate memory) [pid 23816] mmap(NULL, 918541469, PROT_READ, MAP_PRIVATE, 3, 0) = -1 ENOMEM (Cannot allocate memory) [pid 23816] write(2, "fatal: Out of memory? mmap faile"..., 58) = 58 [pid 23816] exit_group(128) = ? 
user1934268

+0

这里是第一笔收入https://www.dropbox.com/s/fw7mi7andnu0zuw/sss – user1934268

+0

有趣。我没有明确的答案,只是看起来很明显,内存不足。难道你只是有一个巨大的“/idol/.client/.git/modules/_aaa/packed-refs”文件? 这只是一个加速git查找的文本文件 - 而不是在文件系统中查找对象。另外,你说你玩过git gc - 你试过git gc --aggressive --prune = now吗? – mockinterface