git/list[1] front-page[2] threads[3] people[4] search[5] about
 

unexpected auto-maintenance, was Re: git hogs the CPU, RAM and storage despite its config

From
Jeff King <peff@peff.net>
Date
May 8, 2026, 18:03 UTC
Message-ID
<20260508180341.GB737125@coredump.intra.peff.net>
In-Reply-To
<CAKcFC3arsYExb5dCMQspo4V9UFDadFaj8Q4PUsMWZJw_eYrMzA@mail.gmail.com>
On Mon, May 04, 2026 at 05:27:21PM +0200, jean-christophe manciot wrote:
> [gc]
>     auto = 0

This is enough to disable auto-gc. But these days we also (instead?) run git-maintenance, which is controlled by maintenance.auto. So you probably are getting a bunch of background git-maintenance runs kicked off.

Show 6 quoted lines
> [pack]
>     threads = 1
>     windowMemory = 1g
> 
> I expected git to use maximum one thread for packing and I'm surprised
> it even tried to perform packing as gc.auto was disabled.

This should work to tell pack-objects to use only one thread, but that is one thread per invocation. And we were probably kicking off a ton of processes due to the background maintenance (and worse, they were all doing the same work redundantly and maybe even stepping on each others toes).

+cc Stolee for wisdom on all things git-maintenance.

Should maintenance.auto fall back to gc.auto for compatibility and avoiding unwanted surprises when people upgrade?

Also, should background maintenance be locking to avoid multiple runs? It does not seem to do so, and if I run:

  git init
  for i in $(seq 10000); do
    echo $i >>file
    git add file
    git commit -m "commit $i"
  done

I get several concurrent pack-objects processes. After a few thousand commits I got bored and hit ^C, and the resulting repo was corrupt! Which is not too surprising, as multiple simultaneous repacks are known to be unsafe, but means we should probably avoid them.

-Peff
Previous: jean-christophe manciotNext: Mikael Magnusson
Message 2 of 15 in “git hogs the CPU, RAM and storage despite its config”
  1. jean-christophe manciotMay 4, 2026
  2. unexpected auto-maintenance, was Re: git hogs the CPU, RAM and storage despite its configJeff King, May 8, 2026
  3. Mikael MagnussonMay 9, 2026
  4. Jeff KingMay 9, 2026
  5. Jeff KingMay 9, 2026
  6. Taylor BlauMay 9, 2026
  7. Derrick StoleeMay 10, 2026
  8. Taylor BlauMay 10, 2026
  9. Patrick SteinhardtMay 11, 2026
  10. Jeff KingMay 11, 2026
  11. Jeff KingMay 11, 2026
  12. Jeff KingMay 11, 2026
  13. Jacob KellerMay 11, 2026
  14. Jeff KingMay 11, 2026
  15. Jacob KellerMay 11, 2026

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.