diff options
author | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | 2018-04-15 17:36:17 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-04-16 13:52:29 +0900 |
commit | 9806f5a7bf3d02247c2c500ef74f56213cd7b07a (patch) | |
tree | d81f3de59393e27d084d010e68c9f6f1b10fefa3 /Documentation | |
parent | gc: handle a corner case in gc.bigPackThreshold (diff) | |
download | tgif-9806f5a7bf3d02247c2c500ef74f56213cd7b07a.tar.xz |
gc --auto: exclude base pack if not enough mem to "repack -ad"
pack-objects could be a big memory hog especially on large repos,
everybody knows that. The suggestion to stick a .keep file on the
giant base pack to avoid this problem is also known for a long time.
Recent patches add an option to do just this, but it has to be either
configured or activated manually. This patch lets `git gc --auto`
activate this mode automatically when it thinks `repack -ad` will use
a lot of memory and start affecting the system due to swapping or
flushing OS cache.
gc --auto decides to do this based on an estimation of pack-objects
memory usage, which is quite accurate at least for the heap part, and
whether that fits in half of system memory (the assumption here is for
desktop environment where there are many other applications running).
This mechanism only kicks in if gc.bigBasePackThreshold is not configured.
If it is, it is assumed that the user already knows what they want.
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'Documentation')
-rw-r--r-- | Documentation/git-gc.txt | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/Documentation/git-gc.txt b/Documentation/git-gc.txt index 649faddfa6..0fb1d43b2c 100644 --- a/Documentation/git-gc.txt +++ b/Documentation/git-gc.txt @@ -59,8 +59,13 @@ If the number of packs exceeds the value of `gc.autoPackLimit`, then existing packs (except those marked with a `.keep` file or over `gc.bigPackThreshold` limit) are consolidated into a single pack by using the `-A` option of -'git repack'. Setting `gc.autoPackLimit` to 0 disables -automatic consolidation of packs. +'git repack'. +If the amount of memory is estimated not enough for `git repack` to +run smoothly and `gc.bigPackThreshold` is not set, the largest +pack will also be excluded (this is the equivalent of running `git gc` +with `--keep-base-pack`). +Setting `gc.autoPackLimit` to 0 disables automatic consolidation of +packs. + If houskeeping is required due to many loose objects or packs, all other housekeeping tasks (e.g. rerere, working trees, reflog...) will |