Windows Codex app may leave large numbers of stale git.exe process/token objects
Summary
During a long-running Codex for Windows session involving repeated local Git and PowerShell operations, system RAM climbed above 30 GB on a 32 GB machine. Kernel pool analysis showed unusually high Proc and Toke allocations and a very large discrepancy between live processes and the Windows process-object performance counter.
This report is about a possible Codex child-process lifecycle issue or interaction with a Windows/security driver. The evidence shows correlation with Git-heavy Codex activity, but does not establish that Codex itself retained the kernel objects.
Environment
- Codex for Windows package path version:
OpenAI.Codex_26.616.9593.0_x64 - Codex executable file/product version:
149.0.7827.115 - Windows 11 Pro
10.0.26200(build 26200) - RAM: 32 GB
- Local repository workflow
- Codex thread ID:
019ebe00-b51c-7fa1-ba7d-191289f7dbe6
Contact email, if further diagnostics are useful: todd10000@gmail.com
Workload before the incident
- A long-running Codex desktop thread, including overnight continuation.
- Many repository operations:
git status, diff, fetch, commit, push, and validation checks. - Many short-lived PowerShell commands launched through Codex.
- Repeated Excel COM regression tests and read-only web-service tests.
- No intentional process-spawning loop.
- GitHub CLI was not the Git binary used for most repository work; Codex's bundled Git runtime was used.
Observed behavior
- Total memory usage continuously rose above 30 GB.
- Task Manager showed roughly 4-5 GB Nonpaged Pool and over 2 GB Paged Pool.
- RAMMap/WPA showed approximately:
Proc: 1.8-2.0 GBToke: about 1.0 GB- Nonpaged Pool: about 5 GB
(Get-Process).Countremained around 180.Get-Counter '\Objects\Processes'reported about 551,745 process objects.- Repeated samples were essentially flat:
551745,551747,551747, suggesting historical accumulation rather than rapid growth at that moment. - Handle and live-process counts otherwise appeared normal.
A partial !process 0 0 WinDbg enumeration was stopped after about ten minutes. The partial image counts included:
git.exe 1060
conhost.exe 561
svchost.exe 93
Codex.exe 9
powershell.exe 5
These counts are only a partial sample, not a complete enumeration.
Other investigation
wtd.sys/ Web Threat Defense Service was stopped and disabled during diagnosis; the memory issue continued.- WPA did not identify a single obvious third-party driver as the dominant CPU consumer.
- A complete memory dump could not be collected under memory pressure. A partial kernel stack dump was collected, but several WinDbg commands could not complete against it.
- No kernel drivers or services were installed or modified by Codex during the project work.
Recovery
A Windows reboot immediately restored normal memory usage:
- About 9 GB in use and 22 GB available after reboot.
- Subsequent sample: approximately 218 live processes, 634 process objects, 486 MB Nonpaged Pool.
- Nonpaged Pool remained stable over a short sample.
Expected behavior
Exited Git, PowerShell, console-host, and other child-process objects should be released without long-term growth in Proc/Toke kernel pool allocations.
Actual behavior
Hundreds of thousands of process objects appeared to remain referenced after the corresponding user-mode processes had exited, eventually consuming most physical memory.
Possible reproduction / monitoring
The issue has not yet been reliably reproduced after reboot. A useful monitoring setup while running a Git-heavy Codex session is:
(Get-Process).Count
(Get-Counter '\Objects\Processes').CounterSamples.CookedValue
(Get-Counter '\Memory\Pool Nonpaged Bytes').CounterSamples.CookedValue / 1MB
A recurrence would be indicated by the process-object counter climbing dramatically while the live process count remains relatively stable.
Privacy
No repository contents, credentials, customer data, employee data, or application logs are included in this public report. The original local investigation summary can be provided privately if OpenAI requests it.
5 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
Additional investigation found a likely trigger that strongly connects this report to #29110, #28631, and especially #26812.
I checked the affected machine after reading #29110:
%USERPROFILE%\.codexitself contains no.gitentry..gitdirectory with no.git/HEAD.Sanitized layout:
This suggests a plausible chain:
.gitdirectory causes Codex desktop Git discovery or metadata refresh to retry continuously, matching #29110 and #28631.git.exe/conhost.execreation rate matches #17229, #20567, and #26812.Proc/Tokekernel pools until RAM usage exceeded 30 GB.Issue #26812 is particularly close: it reports Windows Git/conhost process churn correlated with Nonpaged Pool growth. This issue adds evidence of the more severe endpoint: roughly 551,745 process objects versus about 180 live processes and several GB of
Proc/Tokepool allocations.I have not removed the broken
.gitdirectory yet, so its state remains available for further inspection. Local paths and repository contents remain omitted.Mitigation result:
.gitdirectory was completely empty and had noHEAD..gitdirectory.git.exePIDs and 0 Git sightings while Codex remained open. The previous high-rate Git storm was therefore not visible after removing the broken outer.gitdirectory.This substantially strengthens the broken-workspace-metadata trigger shared with #29110/#28631. The severe kernel process/token retention remains the additional impact documented in this issue.
Closing as a duplicate of #29110, with related reports in #28631 and #26812. The relevant reproduction evidence and mitigation observations are already recorded above.
Codex Desktop repeatedly spawned git.exe:
109 git.exe observed in 30s.
Commands included rev-parse --show-toplevel, status --porcelain, core.fsmonitor.
Paged Pool resident reached ~3.8GB, Nonpaged Pool ~1.4GB.
Earlier xperf showed SepDuplicateToken / Toke / SeAt allocations during Git process creation.
Restarting Codex did not reclaim accumulated kernel pool; reboot required.