{"thread":{"id":"66447","subject":"Windows: ~1 GB RAM per git process, many concurrent (2.56.0.windows.1)","startedAt":"2026-10-02T11:04:07Z","lastAt":"2026-10-02T22:19:31Z","messageCount":3,"participants":["Pierre Bruno","brian m. carlson","Jeff King"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"553952","messageId":"BL0PR05MB5603A8CE8FD78127FB810BE2D8892@BL0PR05MB5603.namprd05.prod.outlook.com","threadId":"66447","inReplyTo":null,"subject":"Windows: ~1 GB RAM per git process, many concurrent (2.56.0.windows.1)","fromName":"Pierre Bruno","fromEmail":"pierrebruno@hotmail.ch","sentAt":"2026-10-02T11:04:00Z","receivedAt":"2026-10-02T11:04:07Z","isPatch":false,"body":"Hi,\n\nOn Windows, git status-type commands use about 1 GB of RAM per\nprocess, and dozens run at once when I use coding agents (OpenCode and\nOh My Pi) in a repository. CPU is near 0%, disk I/O is steady, and the\ntotal is several GB. Since two unrelated tools cause it, I suspect git\nor my repo.\n\nExpected: a few short-lived git processes with far less memory.\n\ngit version 2.56.0.windows.1 (commit 49d759b698127791a5f3f2759c69b983846711dd,\nfsmonitor--daemon enabled), Windows <version>\nRepo: <N files / GB>, <N> untracked files\nManual 'git status' with no other tool running: <fast/slow, memory>\nStable 2.55.0: <same/different>\nCommand line seen in Task Manager: <paste>\n\nIs ~1 GB per process expected here, and is there a recommended config to\nreduce it? Full 'git bugreport' attached.\n\nThanks,\nPierre Bruno"},{"id":"554005","messageId":"asAF7D_XefgKtgf6@fruit.crustytoothpaste.net","threadId":"66447","inReplyTo":"BL0PR05MB5603A8CE8FD78127FB810BE2D8892@BL0PR05MB5603.namprd05.prod.outlook.com","subject":"Re: Windows: ~1 GB RAM per git process, many concurrent (2.56.0.windows.1)","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2026-10-02T19:28:45Z","receivedAt":"2026-10-02T19:28:47Z","isPatch":false,"body":"On 2026-10-02 at 11:04:00, Pierre Bruno wrote:\n> Hi,\n> \n> On Windows, git status-type commands use about 1 GB of RAM per\n> process, and dozens run at once when I use coding agents (OpenCode and\n> Oh My Pi) in a repository. CPU is near 0%, disk I/O is steady, and the\n> total is several GB. Since two unrelated tools cause it, I suspect git\n> or my repo.\n> \n> Expected: a few short-lived git processes with far less memory.\n> \n> git version 2.56.0.windows.1 (commit 49d759b698127791a5f3f2759c69b983846711dd,\n> fsmonitor--daemon enabled), Windows <version>\n> Repo: <N files / GB>, <N> untracked files\n> Manual 'git status' with no other tool running: <fast/slow, memory>\n> Stable 2.55.0: <same/different>\n> Command line seen in Task Manager: <paste>\n> \n> Is ~1 GB per process expected here, and is there a recommended config to\n> reduce it? Full 'git bugreport' attached.\n\nI think you omitted the attachment, but in any event, I would say that\nthis is not normally expected for `git status`.  We'd really need to\nknow what the command line of those processes is for us to know what\nthey're for; for instance, you may be triggering maintenance on the\nrepository, in which case packing a large repository could legitimately\nuse that much memory.  Similarly, if you're using a file system monitor\nprocess, that could consume a large amount of memory in a large\nrepository.\n\nI don't personally use Windows, so I'm afraid I can't tell you how to\nget that information there.  Once you have it, though, it should be\nclearer if that's a reasonable amount of memory to be using given the\nsize of your repository.\n-- \nbrian m. carlson (they/them)\nToronto, Ontario, CA\n"},{"id":"554017","messageId":"20261002221929.GB833115@coredump.intra.peff.net","threadId":"66447","inReplyTo":"BL0PR05MB5603A8CE8FD78127FB810BE2D8892@BL0PR05MB5603.namprd05.prod.outlook.com","subject":"Re: Windows: ~1 GB RAM per git process, many concurrent (2.56.0.windows.1)","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2026-10-02T22:19:29Z","receivedAt":"2026-10-02T22:19:31Z","isPatch":false,"body":"On Fri, Oct 02, 2026 at 11:04:00AM +0000, Pierre Bruno wrote:\n\n> On Windows, git status-type commands use about 1 GB of RAM per\n> process, and dozens run at once when I use coding agents (OpenCode and\n> Oh My Pi) in a repository. CPU is near 0%, disk I/O is steady, and the\n> total is several GB. Since two unrelated tools cause it, I suspect git\n> or my repo.\n\nIs that counting shared, mmap'd memory? Git will mmap the on-disk\npackfiles (or on Windows, CreateFileMapping/MapViewOfFile). So if your\nrepository has a 1GB packfile, that could explain it. And it can lead to\ntwo unintuitive conclusions:\n\n  1. If you have several git-status processes, they're sharing all of\n     those pages. So it's still only 1GB of memory use.\n\n  2. Git will make a large map and assume the OS will fault in only the\n     pages that are needed. So you may see a large virtual memory size,\n     but a lower resident size (these are the terms I'd expect from\n     \"top\" on Linux; I don't know what terms you might see on Windows).\n\nYou may also see a large resident size if the OS has faulted in all of\nthose pages (e.g., due to other commands). Ironically this is a sign\nthat you _don't_ have a lot of memory pressure (otherwise, the unused\npages would have been dropped). Again, this is coming from the Linux\nside of things; I don't know how aggressively (or not) Windows is about\nfaulting in or releasing pages from mapped files.\n\n-Peff\n"}]}