75

リポジトリで問題が発生し、そこで見つかったほぼすべての構成設定を試しました。pack.WindowMemory など

誰かが大きなファイルをリモート リポジトリにチェックインしたと思われますが、プルまたはプッシュしようとするたびに、GIT はファイルを圧縮しようとし、メモリ不足になります。

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 gcgit repackを試しましたが、同じエラーが返され続けます。

ほとんどあきらめて、新しいレポを作成しようとしていますが、最初に聞いてみようと思いました:)

4

5 に答える 5

113

ここで私のために働いた解決策を見つけました。

.git/config ファイル (クライアントおよび/またはサーバー) に、次を追加しました。

[core]
  packedGitLimit = 128m
  packedGitWindowSize = 128m

[pack]
  deltaCacheSize = 128m
  packSizeLimit = 128m
  windowMemory = 128m
于 2012-10-09T21:01:33.260 に答える
20

参考までに(すでに見たことがあるかもしれませんが)、その問題を扱っているmsysgitのケースはチケット292です。

これは、いくつかの回避策を示唆しています。

特定のファイルのデルタ圧縮を無効にするには.git/info/attributes、に次を追加します。

*.zip binary -delta

Gitattributesのマニュアルページから:

delta属性がfalseに設定されているパスのblobに対して、デルタ圧縮は試行されません。


おそらく、より簡単な回避策は、その大きなファイルをコミットする前に履歴をリセットし、そこから他のコミットをやり直すことです。

于 2012-04-24T07:10:38.537 に答える
15

編集: git-v2.5.0 (2015 年 8 月)以降、git-for-windows (以前の MSysGit)は、 Pan.studentによって通知される64 ビット バージョン
を       提供します。       この回答では、Cygwin 64 ビットをインストールするようアドバイスしていました (64 ビットの Git バージョンを提供します)。


4GB バリアに到達したときに、MSysGitを使用して同様のOut of memory, malloc failed問題が発生しました。

> 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

4 GB バリアに達した後に MSysGit がクラッシュする

最後に、Cygwinから 64 ビットを git して修正します。

> 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

Cygwin からの git 64 ビットが成功しました

linuxhost64ビットの参考までに:

repo.git> git config -l
user.email=name@company.com
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

私の回答で問題が解決しない場合は、次のページも確認してください。

于 2013-08-29T16:15:17.753 に答える
-1

これは私にとってはうまくいきましたが、次を使用してコマンドラインからオプションを設定する必要がありました。

git --global core\pack [param] value
于 2016-06-16T14:23:36.780 に答える