Windows internal shell: repeated cmd exits increase Objects\Processes and nonpaged pool
What version of the Codex App are you using (From “About Codex” dialog)?
26.623.13972.0
What subscription do you have?
Unknown / not relevant to the local repro.
What platform is your computer?
Microsoft Windows 11 Pro 10.0.26200 x64
What issue are you seeing?
From the Codex internal shell on Windows, repeated short-lived child processes appear to increase kernel process-object accounting and nonpaged pool usage even after the child processes exit.
This repro intentionally does not use any project-specific CLI or custom tooling. It only starts cmd.exe and waits for it to exit.
Observed result from a regular user shell:
cmd /c exit, 30 iterations
Objects\Processes: +320
Memory\Pool Nonpaged Bytes: +372,736 bytes (~0.37 MB)
cmd failures: 0
I did not see lingering cmd.exe processes after the loop. The concern is that kernel process object accounting / nonpaged pool still increases with simple process churn from the internal shell.
What steps can reproduce the bug?
Run this from the Codex internal shell on Windows:
$beforeO = Get-CimInstance Win32_PerfRawData_PerfOS_Objects
$beforeM = Get-CimInstance Win32_PerfRawData_PerfOS_Memory
$fail = 0
for ($i = 0; $i -lt 30; $i++) {
$p = Start-Process -FilePath "$env:ComSpec" -ArgumentList '/d','/c','exit','0' -PassThru -WindowStyle Hidden
$p.WaitForExit()
if ($p.ExitCode -ne 0) { $fail++ }
$p.Dispose()
}
Start-Sleep -Seconds 3
$afterO = Get-CimInstance Win32_PerfRawData_PerfOS_Objects
$afterM = Get-CimInstance Win32_PerfRawData_PerfOS_Memory
[pscustomobject]@{
user = (whoami)
failures = $fail
objectProcessesDelta = ([int64]$afterO.Processes - [int64]$beforeO.Processes)
poolNonpagedDelta = ([int64]$afterM.PoolNonpagedBytes - [int64]$beforeM.PoolNonpagedBytes)
beforeObjectProcesses = [uint64]$beforeO.Processes
afterObjectProcesses = [uint64]$afterO.Processes
beforeNonpaged = [uint64]$beforeM.PoolNonpagedBytes
afterNonpaged = [uint64]$afterM.PoolNonpagedBytes
} | ConvertTo-Json
Observed output:
{
"user": "desktop-d8hsnu8\\park",
"failures": 0,
"objectProcessesDelta": 320,
"poolNonpagedDelta": 372736,
"beforeObjectProcesses": 262094,
"afterObjectProcesses": 262414,
"beforeNonpaged": 3988140032,
"afterNonpaged": 3988512768
}
What is the expected behavior?
Short-lived child process churn from the internal shell should not cause sustained growth in kernel process-object accounting or nonpaged pool after the child processes have exited.
If this is caused by a Windows/security-driver interaction rather than Codex directly, it would still be useful for Codex to reduce internal-shell process churn on Windows, because repeated shell/git/status operations can amplify the issue.
Additional information
A related but distinct symptom was reported in #25935 for orphaned git.exe processes. This report is about kernel object/nonpaged growth from a minimal cmd /c exit loop where no project-specific tooling is involved and no lingering cmd.exe processes were observed.
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗