在结帐时内存不足 [英] git out of memory on checkout

查看:191
本文介绍了在结帐时内存不足的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


克隆成功,但签出失败

I have cloned a large repo and got an error (after several attempts)

我克隆了一个大的回购站点,

Clone succeeded, but checkout failed

当试图用

When trying to fix this with

git checkout -f HEAD

错误回来

致命:内存不足,realloc failed2

Fatal: Out of memory, realloc failed2

我已经设置了一些内存限制,通过设置

I've already set some memory limits higher because the cloning also ran into problems by setting

git config pack.WindowMemory 256m && git config pack.packSizelimit 256m

根据以下Punit Vara的建议, .git / config:

Based on advice below from Punit Vara (below) I've also edited the .git/config to:

[core]
packedGitLimit = 128m
  packedGitWindowSize = 128m

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

我尝试将这些值更改为:128m,256m,512m,1024m。这对我不起作用。我仍然得到了同样的错误,似乎在41%。

And I've tried changing these values to: 128m, 256m, 512m, 1024m. This didn't work for me. I still get the same error that seems to appear at 41%.

任何人都有这方面的经验或任何想法,这是错误的和/或可以做什么解决这个?谢谢。

Anyone has experience with this or any idea where this is going wrong and/or what can be done to solve this? Thanks.

推荐答案

在我的服务器更新到64位架构后,我遇到了同样令人讨厌的问题。 git的操作系统内存限制为600米。

I encountered the same annoying problem after my server was updated to 64Bit architecture. The OS memory limit for git was at 600m.

core.preloadIndex = false

终于为我做了诡计。从git版本2.1开始,它默认为true

finally did the trick for me. It defaults to true since git version 2.1

这篇关于在结帐时内存不足的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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