English 中文(简体)
视窗 “记忆——红 failed失败”
原标题:Git on Windows, "Out of memory - malloc failed"
  • 时间:2012-04-24 06:38:58
  •  标签:
  • windows
  • 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

∗∗∗∗ 和amp;git re Pack,有各种选择,但留下同样的错误。

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

最佳回答

我找到了一个解决办法:Here为我工作。

.git/config文档(客户和/或服务器) 我补充说:

[core]
  packedGitLimit = 128m
  packedGitWindowSize = 128m

[pack]
  deltaCacheSize = 128m
  packSizeLimit = 128m
  windowMemory = 128m
问题回答

关于参考(可能已经看到),涉及这一问题的系列案例是:,第292条

它提出了几个工作建议:

对某些档案的直线压缩,.git/info/attributes,改为:

*.zip binary -delta

http://git-scm.com/docs/gitattributes”rel=“nofollow noreferer”

三角洲的压缩不会试图为带上“属性”(>>>/code>的道路进行游说。


也许更简单的工作是,在大案卷投入使用之前,再 some覆.地重塑历史,并从那里兑现其他承诺。

EDIT:  Since git-v2.5.0 (Aug/2015), git-for-windows (formerly MSysGit)
      provides 64-bits versions as noticed by Pan.student.
      In this answer I was advising to install Cygwin 64-bits (providing 64-bits Git version).


页: 1 http://code.google.com 在达到4GB屏障时:

> git --version
git version 1.8.3.msysgit.0

> file path/Git/cmd/git
path/Git/cmd/git: PE32 executable for MS Windows (console) Intel 80386 32-bit

> time git clone --bare -v ssh://linuxhost/path/repo.git
Cloning into bare repository  repo.git ...
remote: Counting objects: 1664490, done.
remote: Compressing objects: 100% (384843/384843), done.
remote: Total 1664490 (delta 1029586), reused 1664490 (delta 1029586)
Receiving objects: 100% (1664490/1664490), 550.96 MiB | 1.55 MiB/s, done.
Resolving deltas: 100% (1029586/1029586), done.
fatal: Out of memory, malloc failed (tried to allocate 4691583 bytes)
fatal: remote did not send all necessary objects

real    13m8.901s
user    0m0.000s
sys     0m0.015s

MSysGit crashing after reaching 4 GB barrier

最后,从Cygwin fix:

> git --version
git version 1.7.9

> file /usr/bin/git
/usr/bin/git: PE32+ executable (console) x86-64 (stripped to external PDB), for MS Windows

> time git clone --bare -v ssh://linuxhost/path/repo.git
Cloning into bare repository  repo.git ...
remote: Counting objects: 1664490, done.
remote: Compressing objects: 100% (384843/384843), done.
remote: Total 1664490 (delta 1029586), reused 1664490 (delta 1029586)
Receiving objects: 100% (1664490/1664490), 550.96 MiB | 9.19 MiB/s, done.
Resolving deltas: 100% (1029586/1029586), done.

real    13m9.451s
user    3m2.488s
sys     3m53.234s

“git

FYI on linuxhost 64 bits:

repo.git> git config -l
[email protected]
core.repositoryformatversion=0
core.filemode=true
core.bare=true

repo.git> git --version
git version 1.8.3.4

repo.git> uname -a
Linux linuxhost 2.6.32-279.19.1.el6.x86_64 #1 SMP Sat Nov 24 14:35:28 EST 2012 x86_64 x86_64 x86_64 GNU/Linux

如果我的回答没有确定你的问题,你也可以检查这些网页:

部分答复中建议的一些备选办法似乎仅与问题部分相关,或根本没有必要。

From looking at https://git-scm.com/docs/git-config, it appears that just setting the following option is sufficient (set only for the project here):

git config 包装:windowMemory 512m

手册:

包装:windowMemory

包裹门标中的每个胎面所消耗的记忆的最大尺寸,在指挥线上没有限制的情况下,为包装窗户记忆所消耗的记忆。 价值可与“k”、“m”或“g”相匹配。 离开未配置(或明确规定为0),将无限制。

因此,我从未接过特定的512米per thread,实际使用的援助团约占时间的一半。 当然,这里选定的数额取决于现有的区域援助团和校对数量。

I came across this error message on Ubuntu. In my case a large committed file was causing issues. I realized the issue was due to a file that I hadn t noticed initially.

Identify Large Files:

为了查明吉特历史上的大量档案,你可以使用以下指挥系统:

git rev-list --objects --all | git cat-file --batch-check= %(objecttype) %(objectname) %(objectsize) %(rest)  | sed -n  s/^blob //p  | sort --numeric-sort --key=2 | cut -c 1-12,41- | $(command -v gnumfmt || echo numfmt) --field=2 --to=iec-i --suffix=B --padding=7 --round=nearest

This command lists the objects in the Git history, sorts them by size, and displays the file sizes in a human-readable format.

Source: How to find/identify large commits in Git history

Remove Grand file:

一旦确定,你就可以利用以下指挥从Gite史上删除大档案:

git filter-branch --force --index-filter  git rm --cached --ignore-unmatch path/to/my/file.jpg  --prune-empty --tag-name-filter cat -- --all

这一指挥系统过滤了分局的历史,删除了具体档案。

资料来源:。 移除大宗历史档案

最新情况:

之后,确保删除档案或将其添加到.gitignore:

echo  path/to/my/*  >> .gitignore

记住增加、承诺和推动这些变化,以便在你的边远存放处反映出这些变化。

希望这将有助于。

In my case the config changes above didn t help. What helped was a simple server reboot (in my case sudo shutdown -r now). Looks like something was eating lots of memory on the server. Hope this helps someone, too.

这为我工作,但我不得不通过指挥线,利用:

git --global corepack [param] value




相关问题
Why running a service as Local System is bad on windows?

I am trying to find out the difference between difference service account types. I tumbled upon this question. The answer was because it has powerful access to local resources, and Network Service ...

Programmatically detect Windows cluster configuration?

Does anyone know how to programatically detect that a Windows server is part of a cluster? Further, is it possible to detect that the server is the active or passive node? [Edit] And detect it from ...

get file icon for Outlook appointment (.msg)

I ve read Get File Icon used by Shell and the other similar posts - and already use SHFileInfo to get the associated icon for any given extension, and that works great. However, Outlook uses ".msg" ...

Identifying idle state on a windows machine

I know about the GetLastInputInfo method but that would only give me the duration since last user input - keyboard or mouse. If a user input was last received 10 minutes ago, that wouldn t mean the ...

Terminating a thread gracefully not using TerminateThread()

My application creates a thread and that runs in the background all the time. I can only terminate the thread manually, not from within the thread callback function. At the moment I am using ...

热门标签