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

Re: Windows: ~1 GB RAM per git process, many concurrent (2.56.0.windows.1)

From
Jeff King <peff@peff.net>
Date
Oct 2, 2026, 22:19 UTC
Message-ID
<20261002221929.GB833115@coredump.intra.peff.net>
In-Reply-To
<BL0PR05MB5603A8CE8FD78127FB810BE2D8892@BL0PR05MB5603.namprd05.prod.outlook.com>
On Fri, Oct 02, 2026 at 11:04:00AM +0000, Pierre Bruno wrote:
Show 5 quoted lines
> On Windows, git status-type commands use about 1 GB of RAM per
> process, and dozens run at once when I use coding agents (OpenCode and
> Oh My Pi) in a repository. CPU is near 0%, disk I/O is steady, and the
> total is several GB. Since two unrelated tools cause it, I suspect git
> or my repo.

Is that counting shared, mmap'd memory? Git will mmap the on-disk packfiles (or on Windows, CreateFileMapping/MapViewOfFile). So if your repository has a 1GB packfile, that could explain it. And it can lead to two unintuitive conclusions:

  1. If you have several git-status processes, they're sharing all of
     those pages. So it's still only 1GB of memory use.
  2. Git will make a large map and assume the OS will fault in only the
     pages that are needed. So you may see a large virtual memory size,
     but a lower resident size (these are the terms I'd expect from
     "top" on Linux; I don't know what terms you might see on Windows).

You may also see a large resident size if the OS has faulted in all of those pages (e.g., due to other commands). Ironically this is a sign that you _don't_ have a lot of memory pressure (otherwise, the unused pages would have been dropped). Again, this is coming from the Linux side of things; I don't know how aggressively (or not) Windows is about faulting in or releasing pages from mapped files.

-Peff
Previous: brian m. carlson
Message 3 of 3 in “Windows: ~1 GB RAM per git process, many concurrent (2.56.0.windows.1)”
  1. Pierre BrunoOct 2, 2026
  2. brian m. carlsonOct 2, 2026
  3. Jeff KingOct 2, 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.