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
The footer component creates recursive timeouts but only cleans up the last one:
// Before (leak):lettimeout=setTimeout(()=>tick(),10000)onCleanup(()=>clearTimeout(timeout))// Only clears last timeout// After (fixed):consttimeouts=[]timeouts.push(setTimeout(()=>tick(),10000))onCleanup(()=>timeouts.forEach(clearTimeout))// Clears all
Hundreds of uncleaned timers accumulate over time.
When reinitializing MCP clients, the old one was overwritten without closing:
// Before (leak):s.clients[name]=result.mcpClient// Old client still active!// After (fixed):awaitexistingClient?.close()s.clients[name]=result.mcpClient
This is especially critical for Copilot users since it uses the MCP protocol.
// Before (leak):entries.clear()// But recordsByKey still holds reference// After (fixed):entries.clear()recordsByKey.delete(key)// Actually remove the reference
Common Pattern
All three issues stem from the same problem: creating new resources without properly tracking/cleaning up old ones.
Recommendation
Update to the latest version - These fixes are very recent (merged Jan 13-14)
If the issue persists, please export your session to help identify remaining leaks:
The 30 GB growth after a morning of coding matches what I found in the event-reducer. The message.part.delta handler in event-reducer.ts concatenates every incoming delta to a string per part field with no size limit — (existing ?? "") + props.delta. In a long session with lots of tool output, these strings grow into the hundreds of MB each and are never trimmed.
Fixed in #14650 by capping each part field at 1 MB (drops oldest bytes on overflow). The PR also fixes the second major driver: subagent sessions are never deallocated after their task completes, so each one retains its full message history, tool buffers, and event listeners in memory permanently.
Between those two fixes plus 8 other leak sources addressed in the same PR, a 2.5-hour test session with continuous subagent and tool activity stabilized at ~2,500 MB RSS instead of growing unbounded.
Some of the leaks from this issue were fixed in v1.2.10 (footer timeout, SSE reconnect, AbortController), but the delta accumulation and subagent cleanup were still open on the current dev branch.
Activity
github-actions commentedon Jan 17, 2026
This issue might be a duplicate of existing issues. Please check:
Feel free to ignore if none of these address your specific case.
LIHUA919 commentedon Jan 18, 2026
Based on my analysis of the recent memory leak fixes, here are the root causes:
Root Causes
1. TUI Footer Timeout Leak (#8255)
The footer component creates recursive timeouts but only cleans up the last one:
Hundreds of uncleaned timers accumulate over time.
2. MCP Client Not Closed (#8253)
When reinitializing MCP clients, the old one was overwritten without closing:
This is especially critical for Copilot users since it uses the MCP protocol.
3. State Instance Not Removed from Map (#8252)
Common Pattern
All three issues stem from the same problem: creating new resources without properly tracking/cleaning up old ones.
Recommendation
Related Fixes
feat(desktop): add hardware acceleration toggle for Windows
kryptobaseddev commentedon Feb 22, 2026
The 30 GB growth after a morning of coding matches what I found in the event-reducer. The
message.part.deltahandler inevent-reducer.tsconcatenates every incoming delta to a string per part field with no size limit —(existing ?? "") + props.delta. In a long session with lots of tool output, these strings grow into the hundreds of MB each and are never trimmed.Fixed in #14650 by capping each part field at 1 MB (drops oldest bytes on overflow). The PR also fixes the second major driver: subagent sessions are never deallocated after their task completes, so each one retains its full message history, tool buffers, and event listeners in memory permanently.
Between those two fixes plus 8 other leak sources addressed in the same PR, a 2.5-hour test session with continuous subagent and tool activity stabilized at ~2,500 MB RSS instead of growing unbounded.
Some of the leaks from this issue were fixed in v1.2.10 (footer timeout, SSE reconnect, AbortController), but the delta accumulation and subagent cleanup were still open on the current dev branch.
g4challenge commentedon Feb 24, 2026
same behavior on my mac - especially when using long web sessions - up to 68gb ram usage. session ran 2 days.
thdxr commentedon Apr 2, 2026
Closing in favor of #20695 where we're collecting all memory-related problems. Please follow that issue for updates.