fix: address 6 memory leaks for long-running sessions#13594
fix: address 6 memory leaks for long-running sessions#13594feelsodev wants to merge 1 commit intoanomalyco:devfrom
Conversation
|
The following comment was made by an LLM, it may be inaccurate: Potential duplicate PRs found:
Please review PRs #10914 and #12053 to confirm if they overlap with the current PR #13594, particularly regarding the changes to |
bcf473e to
00142d4
Compare
This would supersede #10914 and #12053 and bring significant stability to the Opencode platform and make it way more viable for power-users like myself who want to run multiple sessions for many hours. |
|
Ok
في الاثنين، ١٦ فبراير ٢٠٢٦، ٢١:٤٠ Joe Swan ***@***.***> كتب:
… *TheAllSeeingPie* left a comment (anomalyco/opencode#13594)
<#13594 (comment)>
*The following comment was made by an LLM, it may be inaccurate:*
*Potential duplicate PRs found:*
1.
*PR #10914 <#10914>* -
"fix(opencode): resolve multiple memory leaks in long-running sessions"
- #10914 <#10914>
- *Why related:* Addresses the same issue of memory leaks in
long-running sessions with similar scope
2.
*PR #12053 <#12053>* -
"fix(memory): resolve 6 memory leak issues in long-running sessions"
- #12053 <#12053>
- *Why related:* Explicitly mentions fixing the same "6 memory leak
issues" targeting long-running sessions - likely addresses identical
problems
Please review PRs #10914
<#10914> and #12053
<#12053> to confirm if they
overlap with the current PR #13594
<#13594>, particularly
regarding the changes to queue.ts, bash.ts, lsp/client.ts, bus/index.ts,
pty/index.ts, and the shutdown resource cleanup.
This would supersede #10914
<#10914> and #12053
<#12053> and bring significant
stability to the Opencode platform and make it way more viable for
power-users like myself who want to run multiple sessions for many hours.
—
Reply to this email directly, view it on GitHub
<#13594 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/B2DFN3SRPYB46OQANEKET7D4MI2ONAVCNFSM6AAAAACVEECD72VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTSMJQGYZDGMRYGU>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
- queue.ts: add close()/drain() methods and termination to AsyncQueue iterator - bash.ts: replace string concatenation with Buffer[] ring buffer (10MB cap) - client.ts: clear diagnostics on shutdown, add 5000-entry LRU eviction - bus/index.ts: clear subscriptions map in dispose callback - pty/index.ts: replace string buffer with chunked array to reduce GC pressure - index.ts: call Instance.disposeAll() in finally block for resource cleanup Closes anomalyco#10913
00142d4 to
9d77518
Compare
Summary
Fixes 6 memory leaks that cause RSS to grow to multi-GB levels during long-running sessions.
Changes
queue.ts— AsyncQueue terminationclose()anddrain()methods withDONEsentinel symbol[Symbol.asyncIterator]now breaks on close instead of looping foreverbash.ts— Output buffer capoutput += chunk.toString()withBuffer[]ring bufferlsp/client.ts— Diagnostics Map cleanupdiagnostics.clear()onshutdown()bus/index.ts— Subscription cleanup on disposesubscriptions.clear()in dispose callback after notifying wildcard listenerspty/index.ts— Buffer chunkingbuffer: stringwithbufferChunks: string[]+bufferLentrackerstring.slice()on every writeindex.ts— Shutdown resource cleanupInstance.disposeAll()infinallyblockTest plan
bunx tsc --noEmit— zero type errorsturbo typecheckacross all 12 packages — all passCloses #10913