You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Windows: memory usage spikes and Codex freezes after repeated context compactions #24095
On Windows, Codex can become unresponsive after a long-running thread has gone through multiple automatic context compactions. Memory usage then climbs quickly and can exhaust available RAM.
Environment
Platform: Windows
App: Codex Desktop
Version: not captured yet
Steps to reproduce
Start a long-running thread in Codex Desktop on Windows.
Continue working until automatic context compaction runs several times.
Keep using the same thread after each compaction.
Watch Codex memory usage in Task Manager.
Actual behavior
After several compactions, the UI can freeze or stop responding.
Codex memory usage rises rapidly.
The machine can get close to running out of memory.
Recovery usually requires killing or restarting Codex, and the same thread may remain difficult to use.
Expected behavior
Codex should stay responsive after repeated context compactions. Memory used by old thread state should be released or bounded instead of growing until the app or system becomes unusable.
Notes
This looks related to #14472 and #19381, but the trigger here is repeated context compaction in the same long-running Windows session, followed by rapid memory exhaustion.
The remaining useful distinction seems to be the exact lag/freeze shape:
opening/selecting an existing large thread freezes,
sending a new prompt in an already-open thread freezes,
memory spikes right after or during context compaction,
Electron main process crashes with RangeError: Invalid string length,
renderer crashes on Markdown/directive parsing.
This report is meant to track case 3 on Windows: repeated compactions in one long-running session, followed by rapid memory growth and UI freeze. I will leave it open for now and try to capture the app version plus whether the spike starts before or after the compacted checkpoint is written.
Activity
github-actions commentedon May 22, 2026
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
Herrtian commentedon May 22, 2026
I reviewed the duplicate suggestions and related reports.
replacement_history.RangeError: Invalid string lengthwhen loading sessions whose rollout JSONL exceeds V8's max string length #22004 and macOS Desktop: image-heavy thread takes minutes to open because rollout JSONL embeds generated image payloads inline #22603 overlap through oversized image-heavy rollouts and full-history hydration.The remaining useful distinction seems to be the exact lag/freeze shape:
RangeError: Invalid string length,This report is meant to track case 3 on Windows: repeated compactions in one long-running session, followed by rapid memory growth and UI freeze. I will leave it open for now and try to capture the app version plus whether the spike starts before or after the compacted checkpoint is written.