Re: [PATCH v2 3/5] gc --auto: exclude base pack if not enough mem to "repack -ad"

2018-03-16 Thread Duy Nguyen
On Thu, Mar 15, 2018 at 8:21 PM, Ævar Arnfjörð Bjarmason wrote: > > On Thu, Mar 15 2018, Duy Nguyen jotted: > >> On Mon, Mar 12, 2018 at 8:30 PM, Ævar Arnfjörð Bjarmason >> wrote: >>> We already have pack.packSizeLimit, perhaps we could call this >>> e.g.

Re: [PATCH v2 3/5] gc --auto: exclude base pack if not enough mem to "repack -ad"

2018-03-15 Thread Ævar Arnfjörð Bjarmason
On Thu, Mar 15 2018, Duy Nguyen jotted: > On Mon, Mar 12, 2018 at 8:30 PM, Ævar Arnfjörð Bjarmason > wrote: >> We already have pack.packSizeLimit, perhaps we could call this >> e.g. gc.keepPacksSize=2GB? > > I'm OK either way. The "base pack" concept comes from the >

Re: [PATCH v2 3/5] gc --auto: exclude base pack if not enough mem to "repack -ad"

2018-03-15 Thread Duy Nguyen
On Mon, Mar 12, 2018 at 8:30 PM, Ævar Arnfjörð Bjarmason wrote: > We already have pack.packSizeLimit, perhaps we could call this > e.g. gc.keepPacksSize=2GB? I'm OK either way. The "base pack" concept comes from the "--keep-base-pack" option where we do keep _one_ base pack.

Re: [PATCH v2 3/5] gc --auto: exclude base pack if not enough mem to "repack -ad"

2018-03-15 Thread Duy Nguyen
On Mon, Mar 12, 2018 at 7:56 PM, Ævar Arnfjörð Bjarmason wrote: > > On Wed, Mar 07 2018, Junio C. Hamano jotted: > >> Duy Nguyen writes: But to those who say "packs larger than this value is too big" via configuration, keeping only the largest of

Re: [PATCH v2 3/5] gc --auto: exclude base pack if not enough mem to "repack -ad"

2018-03-12 Thread Ævar Arnfjörð Bjarmason
On Mon, Mar 12 2018, Junio C. Hamano jotted: > On Mon, Mar 12, 2018 at 11:56 AM, Ævar Arnfjörð Bjarmason > wrote: >> As someone who expects to use this (although hopefully in slightly >> modified form), it's very useful if we can keep the useful semantics in >> gc.* config

Re: [PATCH v2 3/5] gc --auto: exclude base pack if not enough mem to "repack -ad"

2018-03-12 Thread Junio C Hamano
On Mon, Mar 12, 2018 at 11:56 AM, Ævar Arnfjörð Bjarmason wrote: > As someone who expects to use this (although hopefully in slightly > modified form), it's very useful if we can keep the useful semantics in > gc.* config values without needing some external job finding repos

Re: [PATCH v2 3/5] gc --auto: exclude base pack if not enough mem to "repack -ad"

2018-03-12 Thread Ævar Arnfjörð Bjarmason
On Tue, Mar 06 2018, Nguyễn Thái Ngọc Duy jotted: > 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. > > Let's do the suggestion

Re: [PATCH v2 3/5] gc --auto: exclude base pack if not enough mem to "repack -ad"

2018-03-12 Thread Ævar Arnfjörð Bjarmason
On Wed, Mar 07 2018, Junio C. Hamano jotted: > Duy Nguyen writes: >>> But to those who say "packs larger than this value is too big" via >>> configuration, keeping only the largest of these above-threshold >>> packs would look counter-intuitive, wouldn't it, I wonder? >> >> I

Re: [PATCH v2 3/5] gc --auto: exclude base pack if not enough mem to "repack -ad"

2018-03-07 Thread Junio C Hamano
Johannes Schindelin writes: > Junio, may I ask you to put this into a SQUASH??? commit so that the > Windows build no longer fails? Thanks for a reminder; I also spotted it (I first thought I screwed up in my editor while reviewing and then went back to the original

Re: [PATCH v2 3/5] gc --auto: exclude base pack if not enough mem to "repack -ad"

2018-03-07 Thread Junio C Hamano
Duy Nguyen writes: >>> +Set environment variable `GIT_TRACE` in order to see the memory usage >>> +estimation in `git gc --auto` that determines whether the base pack is >>> +kept. >> >> This is somewhat a puzzling use of trace. It sounds more like a way >> to find out "how"

Re: [PATCH v2 3/5] gc --auto: exclude base pack if not enough mem to "repack -ad"

2018-03-07 Thread Duy Nguyen
On Wed, Mar 7, 2018 at 2:19 AM, Junio C Hamano wrote: >> +--keep-base-pack:: >> + All packs except the base pack are consolidated into a single >> + pack. The largest pack is considered the base pack. > > This makes it sound as if packs with .keep are also repacked

Re: [PATCH v2 3/5] gc --auto: exclude base pack if not enough mem to "repack -ad"

2018-03-07 Thread Johannes Schindelin
Hi Duy, On Tue, 6 Mar 2018, Nguyễn Thái Ngọc Duy wrote: > diff --git a/builtin/gc.c b/builtin/gc.c > index 77fa720bd0..273657ddf4 100644 > --- a/builtin/gc.c > +++ b/builtin/gc.c > @@ -187,7 +211,101 @@ static int too_many_packs(void) > return gc_auto_pack_limit < cnt; > } > > -static

Re: [PATCH v2 3/5] gc --auto: exclude base pack if not enough mem to "repack -ad"

2018-03-06 Thread Junio C Hamano
Nguyễn Thái Ngọc Duy writes: > On linux-2.6.git, valgrind massif reports 1.6GB heap in "pack all" > case, and 535MB [1] in "pack all except the base pack" case. We save > roughly 1GB memory by excluding the base pack. ;-) > gc --auto decides to do this based on an

[PATCH v2 3/5] gc --auto: exclude base pack if not enough mem to "repack -ad"

2018-03-06 Thread Nguyễn Thái Ngọc Duy
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. Let's do the suggestion automatically instead of waiting for people to come to Git mailing list