代码之家  ›  专栏  ›  技术社区  ›  Pipo

GIT:remote:fatal:内存不足,malloc失败(尝试分配190135255字节)

  •  2
  • Pipo  · 技术社区  · 6 年前

    尝试克隆大型存储库时,我得到:

    remote: fatal: Out of memory, malloc failed (tried to allocate 190135255 bytes)
    

    看到有一个可能的配置进入 ~/.gitconfig .git/config 在客户机中,但似乎是服务器能够在传递之前生成如此大的文件,我在哪里可以配置服务器上最大malloc的大小?

    我的系统的服务器是

    pi@domP3: ~$ git --version
    git version 2.11.0
    pi@domP3: ~$ lsb_release -a
    No LSB modules are available.
    Distributor ID: Raspbian
    Description:    Raspbian GNU/Linux 9.4 (stretch)
    Release:        9.4
    Codename:       stretch
    
    2 回复  |  直到 6 年前
        1
  •  2
  •   Pipo    6 年前

    嗯,git中没有魔法;如果您使用git(可能是通过ssh),那么规则非常简单:有

    • 存储库的本地 .git/config
    • ~/.gitconfig
    • 制度 /etc/gitconfig

    cd 到存储库并运行 git config git config --global

    问题是,如果只是Pi,您是否有足够的虚拟内存来增加配置中的malloc大小?

        2
  •  0
  •   Pipo    6 年前

    我的工作配置如下所示:

    /mnt/seagate_2_5i/gitRepo/documents.git/config
    
    
    [core]
            repositoryformatversion = 0
            filemode = true
            bare = true
            packedGitWindowSize = 512m
    [pack]
            windowMemory = 512m
    [http]
            postBuffer = 512m