gpt4 book ai didi

git 错误 : out of memory, malloc 失败(尝试分配 X 字节)

转载 作者:行者123 更新时间:2023-12-03 14:19:14 25 4
gpt4 key购买 nike

我最近在尝试克隆 git 存储库时收到以下错误日志:

remote: Counting objects: 4607, done.
error: git upload-pack: git-pack-objects died with error.B/s
fatal: git upload-pack: aborting due to possible repository corruption on the remote side.
remote: fatal: Out of memory, malloc failed (tried to allocate 119483755 bytes)
remote: aborting due to possible repository corruption on the remote side.
fatal: early EOF
fatal: index-pack failed

经过调查,看起来错误来自 repo 服务器。我通过 ssh 连接并尝试了以下所有方法(基本上是谷歌结果的前 2 页提出的所有解决方案):
  • 通过添加以下行来修改配置文件:
    [core]
    packedGitLimit = 512m
    packedGitWindowSize = 512m
    [pack]
    windowMemory = 512m
    packSizeLimit = 512m
    deltaCacheSize = 512m
    threads = 1
    window = 0
  • 尝试了以下命令,产生了以下错误日志:
  • git repack -a -f -d
    Counting objects: 4607, done.
    fatal: Out of memory, malloc failed (tried to allocate 119483755 bytes)
  • git fsck
    fatal: Out of memory, malloc failed (tried to allocate 119483755 bytes)
  • git gc
    fatal: Out of memory, malloc failed (tried to allocate 119483755 bytes)
    error: failed to run repack
  • 所以基本上,它告诉我这是一个内存错误,但我有足够的内存:
  • 自由 -m
                 total       used       free     shared    buffers     cached
    Mem: 12043 10825 1217 0 192 8406
    -/+ buffers/cache: 2226 9816
    Swap: 258 30 228
  • ulimit -a
    core file size          (blocks, -c) 0
    data seg size (kbytes, -d) 131072
    scheduling priority (-e) 0
    file size (blocks, -f) unlimited
    pending signals (-i) 48169
    max locked memory (kbytes, -l) 64
    max memory size (kbytes, -m) unlimited
    open files (-n) 1024
    pipe size (512 bytes, -p) 8
    POSIX message queues (bytes, -q) 819200
    real-time priority (-r) 0
    stack size (kbytes, -s) unlimited
    cpu time (seconds, -t) 1800
    max user processes (-u) 90
    virtual memory (kbytes, -v) 131072
    file locks (-x) unlimited

  • 我会很感激一些帮助,谢谢。

    最佳答案

    这与 GIT: fatal: Out of memory, malloc failed (tried to allocate 889192448 bytes) 相同.

    在 .gitconfig 中进行以下更改解决了我的问题

    [http]
    postbuffer = 9999999999

    这也可能对您有用。还要检查您的 .gitconfig 文件以及正在使用的文件。也尝试释放您的 RAM,这也可能导致问题。

    关于git 错误 : out of memory, malloc 失败(尝试分配 X 字节),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34991407/

    25 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com