2012-03-28 32 views
24

私はgitを使い慣れています。私は は、大規模なリモートサーバーにコミットプッシュしたいが、私はそれはとにかく、私は最高のスレッドを設定することができますgit push fatal:スレッドを作成できません:リソースは一時的に利用できません

Counting objects: 5009, done. 
Delta compression using up to 16 threads. 
fatal: unable to create thread: Resource temporarily unavailable 
error: pack-objects died with strange error 

だからそこにあるエラーを返す

git push origin master 

を使用するときに問題が ですデルタ圧縮に使用します。助けのための

おかげで、

元陳

+0

リモートシステムに 'gitの設定--global pack.windowMemory「100メートル」' 'gitの設定--global pack.packSizeLimit」をロギングすることで、パッキンが取り得るメモリの量を制限するために実行できるコマンド10000 "' 'git config --global pack.threads" 1 "' – Adnan

答えて

2

unable to create thread: Resource temporarily unavailableは」(利用可能なより多くのメモリのような)リモートサーバーとの問題を意味します。

デルタについて、あなたは微調整するには、次のconfigがあります

pack.deltaCacheSize 

The maximum memory in bytes used for caching deltas in git-pack-objects(1) before writing them out to a pack.
This cache is used to speed up the writing object phase by not having to recompute the final delta result once the best match for all objects is found.
Repacking large repositories on machines which are tight with memory might be badly impacted by this though, especially if this cache pushes the system into swapping.
A value of 0 means no limit.
The smallest size of 1 byte may be used to virtually disable this cache. Defaults to 256 MiB.

pack.deltaCacheLimit 

The maximum size of a delta, that is cached in git-pack-objects(1).
This cache is used to speed up the writing object phase by not having to recompute the final delta result once the best match for all objects is found. Defaults to 1000.

SOの質問 "Git pull fails with bad pack header error" 参照他のpack関連のコンフィグを。

2

私もこのエラーが発生しました。簡単にするために、このエラーは100 MBのファイルを50 MB(またはそれ以下)の空き容量があるHDDにコピーするために発生します。サーバーには、この、SSHを修正し、次のコマンドを実行するには、次の

git config --global pack.windowMemory "100m" 
git config --global pack.packSizeLimit "100m" 
+2

これは 'pack.SizeLimit'ではなく' pack.packSizeLimit'でなければなりません。 – yig

75

エラー:「致命的:スレッドを作成することができませんでし:一時的に利用できないリソースを」強く、サーバー上のメモリが不足してきましたを示唆しています大容量のファイルがたくさんあるリポジトリを使用している場合に発生する可能性があります。これは、一般的にもulimit設定のためにも、リパッキングに大量のメモリや限られた仮想メモリが必要になる可能性があります。

とにかく、ここであなたは梱包は(として実行をgitの利用者など)、リモートシステムにログインし、これらのコマンドを入力してかかることがメモリの量を制限するために実行できるコマンドです。

git config --global pack.windowMemory "100m" 
git config --global pack.packSizeLimit "100m" 
git config --global pack.threads "1" 

・ホープこれは機能します。

+15

多くの共有ホスティングソリューションはスレッドを制限します。通常、この回答の最後のコマンドだけでこれを<10にすると問題が解決します。 – Qix

+1

私は共有ホスト上で 'git push 'をリモートにしようとするとこの問題を抱えました。 'pack.threads"を設定する10 "'私のために固定しました。再パック段階に入ったときに 'git gc'を実行しようとしたときも同様の問題がありました。同じ修正。乾杯。 –

+1

サーバーがスマートhttpプロトコルを使用している場合、プロセスのグローバル構成を設定できないことがあります。代わりに 'cd'をgitリポジトリのディレクトリに入れて、' - global 'なしで同じコマンドを実行してください。 – yig

関連する問題