copilot-runtime memory keeps growing when large sessions are resumed and disconnected
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 25/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- javascript, macos
- 领域
- performance
调研方向
The report describes memory that is not released after a resumed session is disconnected, and it gives a repro using CopilotClient, a copied session with a large events.jsonl, and footprint -p on the runtime pid. Start with the resume and disconnect path in the SDK, then look for where the replayed session history is kept after disconnect. Done means memory returns near its baseline after repeated resume/disconnect rounds, shown by a repro that stays flat.
由索引模型根据 Issue 内容生成。
描述
- SDK: @github/copilot-sdk 1.0.27-unstable.40031404408.gba6c003 (the one bundled with VS Code 1.144.0)
- copilot-runtime: 1.0.100-1
- OS: macOS 27.0, arm64
My Mac (16 GB) ran out of memory. macOS showed the Force Quit window, but the mouse and screen stopped responding, so I had to hard reboot it. In the jetsam report, two copilot-runtime processes from VS Code's agent host held 12.8 GB (up about 8 days) and 8.0 GB (up about 3 days). Something else started the actual OOM, but those two were already using more than half the RAM.
Some of my chats are long, with events.jsonl between 150 and 450 MB. So I tried to see where the memory goes. I used the SDK on its own (CopilotClient with a separate home directory and copies of my sessions) and measured with footprint -p on the runtime pid:
- Resuming a session costs about 3 times its events.jsonl: 15 MB file → +100 MB, 250 MB → +750 MB, 439 MB → +1.37 GB.
- After I disconnect the session, the memory doesn't come back. With all three resumed and then disconnected, the runtime stayed at 727 MB.
- Resuming and disconnecting the 250 MB session 14 times in a row: the footprint grew by about 46 MB each time and never came down. The same loop with the 15 MB session stayed flat over 20 rounds.
The agent host log for the 8 GB process had 55 "Evicting idle session" lines and 108 resumes. That adds up to about 7 GB of events.jsonl read back over 3 days. My guess is that each resume of a large session leaves part of the replayed history behind, and evicting an idle session and resuming it later doesn't free it. I may be wrong about the cause, but the numbers above reproduce for me every time.
Steps to reproduce
- Take a session with a large events.jsonl (a couple hundred MB).
- With the SDK, start a client, then resume and disconnect that session in a loop.
- Watch
footprint -p <copilot-runtime pid>after each round.
Expected: after a disconnect, memory goes back to roughly where it was.
Actual: it grows by tens of MB per round until the runtime is restarted.
For now I restart the agent host when it gets too big. That works because chats resume from disk.
- 主要语言
- Java
- 星标
- 10.7k
- 派生
- 1.5k
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
github/copilot-sdk 的其他 Issue
-
Rust: ElicitationRequest drops the tool call id from elicitation.requested可能重新可做 关联的 PR 已关闭且未合并。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
github/copilot-sdk#2900 ·
-
难度 1/5 1 小时以内 新手友好度 84/100
github/copilot-sdk#2876 · 1 条评论 · 1 个 reaction ·
-
Python ModelLimits drops max_output_tokens from model metadata可能重新可做 关联的 PR 已关闭且未合并。 未关闭bug
难度 2/5 1-3 小时 新手友好度 78/100
github/copilot-sdk#2798 · 1 条评论 ·
-
难度 2/5 1-3 小时 新手友好度 65/100
github/copilot-sdk#2759 ·
-
docs/AGENTS.md is repo authoring guidance, but everything in docs/ gets published可能重新可做 关联的 PR 已关闭且未合并。 未关闭documentation
难度 1/5 1 小时以内 新手友好度 85/100
github/copilot-sdk#2758 ·
查看 github/copilot-sdk 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 75/100
ls1intum/thesis-management#1473 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 76/100
LunaDeerMC/Dominion#301 · 1 条评论 ·
-
[FEATURE] Expose external refresh, node-level translog and warmer stats可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭untriaged
难度 2/5 1-3 小时 新手友好度 68/100
opensearch-project/opensearch-prometheus-exporter#680 ·
维护者通常 2 天内回复
-
难度 2/5 1-3 小时 新手友好度 85/100
-
难度 2/5 1-3 小时 新手友好度 66/100
维护者通常 2 天内回复