2013-12-18 45 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