Windows 上的 Git,“内存不足 - malloc 失败" [英] Git on Windows, "Out of memory - malloc failed"

查看:33
本文介绍了Windows 上的 Git,“内存不足 - malloc 失败"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

遇到了存储库的问题,并尝试了几乎所有可能的配置设置,例如.pack.WindowMemory 等

Have run into a problem with repository and tried almost every possible config setting found out there eg. pack.WindowMemory etc etc

我相信有人已经将一个大文件签入到远程存储库,现在每次我尝试拉取或推送到它时,GIT 都会尝试打包它并耗尽内存:

I believe someone has checked in a large file to remote repository and now each time I try and pull or push to it, GIT tries to pack it and runs out of memory:

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 有各种选项,但一直返回相同的错误.

Have tried git gc & git repack with various options but keeps returning same error.

几乎放弃了,正准备创建一个新的仓库,但我想我会先问一下:)

Almost given up and about to just create a new repo but thought I'd ask around first :)

推荐答案

我找到了解决方案 这里 对我有用.

I found a solution Here that worked for me.

在 .git/config 文件(客户端和/或服务器)中,我添加了以下内容:

In .git/config file (client and/or server) I added the following:

[core]
  packedGitLimit = 128m
  packedGitWindowSize = 128m

[pack]
  deltaCacheSize = 128m
  packSizeLimit = 128m
  windowMemory = 128m

这篇关于Windows 上的 Git,“内存不足 - malloc 失败"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆