From 669efd0fd7929c2a3de486921b8243faa3034aa3 Mon Sep 17 00:00:00 2001 From: Allen Webb Date: Fri, 1 Oct 2021 15:25:31 -0500 Subject: [PATCH] subcmds/sync: Disable autoDetach for git gc. gc.autoDetach is enabled by default which makes 'git gc --auto' return immediately and run in background. This can lead to a pile up of operations all using large amounts of memory at the same time. To avoid this set gc.autoDetach to false so that the garbage collect task waits for instances to finish before spawning more. Bug: https://crbug.com/gerrit/15113 Test: repo sync -j # and check the number of 'git gc' processes Change-Id: Ic0815156ba3db03972968f33f6f9f51e4928f23b Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/319835 Tested-by: Allen Webb Reviewed-by: Mike Frysinger --- subcmds/sync.py | 1 + 1 file changed, 1 insertion(+) diff --git a/subcmds/sync.py b/subcmds/sync.py index 3211cbb1..83d6ca13 100644 --- a/subcmds/sync.py +++ b/subcmds/sync.py @@ -622,6 +622,7 @@ later is required to fix a server side protocol bug. % (project.relpath,), file=sys.stderr) project.config.SetString('gc.pruneExpire', 'never') + project.config.SetString('gc.autoDetach', 'false') gc_gitdirs[project.gitdir] = project.bare_git pm.update(inc=len(projects) - len(gc_gitdirs), msg='warming up')