[PATCH/RFC 0/1] Avoid expensive 'repack -ad' in gc --auto
- From
Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
- Date
- Mar 1, 2018, 09:20 UTC
- Message-ID
- <20180301092046.2769-1-pclouds@gmail.com>
- In-Reply-To
- <20180228092722.GA25627@ash>
The series [1] 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 less correct.
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).
[1] https://public-inbox.org/git/%3C20180301091052.32267-1-pclouds@gmail.com%3E/
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(-)
-- 2.16.1.435.g8f24da2e1a