macOS Codex Desktop runaway task worker and app-server consume 12+ GB RAM with sustained high CPU
Summary
Codex Desktop on macOS developed sustained runaway memory and CPU usage during ordinary local task work. A task worker reached approximately 5.5 GB RSS, while codex app-server subsequently remained around 7.0–7.3 GB RSS with 160–200% CPU. The app became slow and unstable.
This resembles #14666 and #21134, but this report includes a separately observed runaway cua_node/bin/node ... kernel.js task worker plus app-server retention after that worker was terminated.
Environment
- Codex Desktop: 26.727.51351 (build 6119)
- Bundled codex CLI: 0.146.0-alpha.9.2
- macOS: 26.5.2 (25F84)
- Architecture: arm64
- Mac model: Mac16,10
- Unified memory: 24 GiB
- Chrome extension installed and enabled; Chrome/Computer Use workflows had been used
- Multiple normal local tasks were present
Observed behavior
Three samples taken several seconds apart showed:
- A child task worker,
cua_node/bin/node ... kernel.js, sustaining roughly 57–95% CPU and growing from about 2.6 GB to 5.5 GB RSS. codex app-serversimultaneously sustaining roughly 130–166% CPU and using roughly 1.1–4.0 GB RSS.- System-wide free memory fell to about 44%.
I sent SIGTERM only to the runaway task worker. It exited cleanly and free memory rose immediately from about 44% to 71%, confirming that it was a material source of pressure.
However, app-server then retained/grew to approximately 6.9–7.3 GB RSS and sustained 158–204% CPU across four additional samples. Sending SIGTERM to app-server caused it to respawn, and system-wide free memory recovered to roughly 79%, although the newly spawned service and Electron processes briefly rebuilt several gigabytes of state.
Expected behavior
- Completed, cancelled, or idle task workers should release their memory and terminate.
- app-server should not retain several gigabytes of task state or peg multiple CPU cores after a task worker exits.
- Long-running or tool-heavy tasks should have bounded local memory growth.
- The app should expose a safe way to identify and reclaim stuck workers without restarting active tasks.
Reproduction pattern
No single deterministic action is known. The failure occurred after using Codex Desktop normally for multiple local tasks, including browser/computer-use capable workflows, and leaving the app running for about an hour. Memory and CPU grew until the UI became slow.
Recovery performed
- Confirmed sustained use across multiple process samples.
- Terminated only the 5.5 GB task worker.
- Confirmed immediate system memory recovery.
- After app-server remained near 7 GB and 160–200% CPU, terminated only app-server.
- app-server respawned and overall memory pressure returned to healthy levels.
No Chrome tabs, plugins, or user files were deleted. No raw session transcript or sensitive project data is attached.
Related issues
- #14666
- #21134
- #11324
3 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
Additional report on the same Codex Desktop build:
26.727.51351This suggests the runaway-memory behavior in
26.727.51351can also occur during a lightweight local Markdown review, rather than only during explicit Computer Use or heavy project workflows.Additional same-build report with heap-level diagnostics
I reproduced a more extreme form of the runaway-memory behavior on the same app build.
Environment
26.727.51351(build6119)26.4(25E5223i)/Applications/ChatGPT.app/Contents/Resources/codexChatGPTObserved behavior
Activity Monitor showed:
codex: approximately 21.08 GB memorysamplereported:vmmap -summaryshowed that the footprint was overwhelmingly native heap allocation rather than mapped files, stacks, or allocator fragmentation:This looks like severe unbounded retention of a very large number of small native allocations. The 6% fragmentation figure makes allocator fragmentation an insufficient explanation for the approximately 20.1 GB of allocated heap content.
Sampled activity
The CPU sample included repeated activity in or around:
codex_tools::code_mode::code_mode_tool_definitions_for_speccodex_core::mcp_tool_exposure::build_mcp_tool_runtimescodex_tools::mcp_tool::parse_mcp_toolcodex_tools::json_schema::parse_tool_input_schemaserde_jsonserialization/allocation pathssqlx-sqlite-worker-*threadsThis is only CPU-stack evidence and does not establish which path owns the retained 20.1 GB.
Reproduction pattern
No deterministic single action is known. This occurred after leaving the app running for approximately four days during normal Codex use. The process retained the 21.4 GB footprint at capture time, with 21.2 GB of writable memory already swapped out by macOS.
Expected behavior
Long-running Codex use should have bounded backend memory growth. Completed or idle task, tool-schema, MCP, session, and database state should be released or evicted rather than accumulating tens of gigabytes.
Public-data safety
The diagnostic excerpts contain no prompts, conversation content, repository paths, home-directory paths, command-line arguments, environment variables, credentials, tokens, email addresses, URLs, or network endpoints. Process identifiers, raw addresses, and binary UUIDs were removed from the public copy.
I have full sanitized
sampleandvmmaptext available. The full sample is approximately 500 KB, so I omitted it from this comment and included the allocation-level findings above.