[PATCH/RFC 0/1] Avoid expensive 'repack -ad' in gc --auto
- Date: Thu, 1 Mar 2018 16:20:45 +0700
- From: Nguyễn Thái Ngọc Duy <pclouds@xxxxxxxxx>
- Subject: [PATCH/RFC 0/1] Avoid expensive 'repack -ad' in gc --auto
The series  I just sent helps reduce pack-objects memory footprint
a bit. But even then it's still a huge memory hog. So this patch makes
a special treatment for gc --auto: avoid it completely.
The trick here is not new (pinning the largest pack with a .keep
file). It's just never done automatically. I think this is a good
thing to do, provided that gc --auto estimates memory usage more or
And "git gc --auto" should run even on weak machines because it's part
of regular repo maintenance. You can't tell people "You can't work on
linux-2.6.git repository because your machine has too little memory".
The only thing left I think I should do is to use an external rev-list
to free up some more memory. But let's see how the first patch goes
first (documents and tests are missing, I know).
Nguyễn Thái Ngọc Duy (1):
gc --auto: exclude the largest giant pack in low-memory config
builtin/gc.c | 125 +++++++++++++++++++++++++++++++++++++++--
builtin/pack-objects.c | 2 +-
config.mak.uname | 1 +
git-compat-util.h | 4 ++
pack-objects.h | 2 +
5 files changed, 128 insertions(+), 6 deletions(-)