VS Code extension: codex app-server memory grows unbounded, exhausts ~54 GB swap, and crashes twice
What version of the IDE extension are you using?
26.727.40816 (openai.chatgpt, Darwin arm64)
What subscription do you have?
ChatGPT Pro
Which IDE are you using?
Visual Studio Code 1.131.0
What platform is your computer?
- macOS 26.5.2 (build 25F84)
- Darwin 25.5.0, arm64
- MacBook Pro with Apple M4 Pro, 14 cores, and 24 GB RAM
What issue are you seeing?
The Codex VS Code extension's background codex app-server process exhibited runaway memory growth during a long-running session and caused two crashes on the same day.
Timeline (America/Toronto):
- Around 4:15 p.m. on July 31, 2026, VS Code was opened and the Codex extension launched normally.
- At 12:05:14 a.m. on August 1, macOS reached critical memory pressure and its kernel-level low-memory mechanism terminated processes. The macOS diagnostic identified Codex as the largest process at that point.
- VS Code's extension host and helper processes restarted automatically between approximately 12:04 and 12:08 a.m.
- The replacement Codex process (
PID 89222) was then observed growing again in real time from approximately 1.4 GB to more than 3 GB RSS while allocated swap climbed to 53.9 GB out of 54 GB. - The second failure displayed the message
Codex stopped unexpectedly; Codex's crash handling terminated the process. - Immediately after Codex exited, free RAM rose to approximately 8.4 GB and allocated swap dropped from approximately 54 GB to 8 GB total, with 6.7 GB used.
The repeated growth after restart and the immediate recovery following process termination strongly indicate process-specific memory retention consistent with a memory leak. The precise internal allocation source has not been isolated.
What steps can reproduce the bug?
- Open a local repository in VS Code with the Codex extension enabled.
- Continue using one long-running Codex conversation with background-agent and tool activity for several hours.
- Allow tasks and tool calls to complete while continuing in the same thread.
- Monitor the
codex app-serverprocess RSS and system swap usage. - Observe that RSS continues to grow instead of returning to a stable baseline.
- Continue until macOS reaches critical memory pressure or Codex terminates unexpectedly.
A short minimal reproduction is not yet available, but the growth repeated after the VS Code extension host restarted during the same working session.
What is the expected behavior?
The extension's background process should keep memory bounded and release memory associated with completed agents, tool output, and thread state. It should not exhaust physical memory and swap, trigger a macOS low-memory termination, or crash and restart the extension.
Additional information
- In-product
/feedbacksession ID: unavailable at the time of filing. - Sanitized VS Code/Codex logs, extension-host logs, screenshots, and the macOS memory-pressure diagnostic can be provided privately on request.
- No raw logs are attached here because they may contain local paths, repository details, or conversation content.
- Possibly related issues: #24048, #20781, and #29510.
1 Comment
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action