copilot-runtime memory keeps growing when large sessions are resumed and disconnected
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Anfängerfreundlichkeit
- 25/100
- Issue-Typ
- Bug
- Klarheit
- Größtenteils klar
- Aktivitätsstatus
- Aktiv
- Tech-Stack
- javascript, macos
- Bereich
- performance
Rechercherichtung
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.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
- 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.
- Vorherrschende Sprache
- Java
- Sterne
- 10.7k
- Forks
- 1.5k
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Keine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus github/copilot-sdk
-
Rust: ElicitationRequest drops the tool call id from elicitation.requestedEvtl. wieder frei Ein Pull Request dazu wurde ohne Merge geschlossen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
github/copilot-sdk#2900 ·
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 84/100
github/copilot-sdk#2876 · 1 Kommentar · 1 Reaktion ·
-
Python ModelLimits drops max_output_tokens from model metadataEvtl. wieder frei Ein Pull Request dazu wurde ohne Merge geschlossen. Offenbug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
github/copilot-sdk#2798 · 1 Kommentar ·
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 65/100
github/copilot-sdk#2759 ·
-
docs/AGENTS.md is repo authoring guidance, but everything in docs/ gets publishedEvtl. wieder frei Ein Pull Request dazu wurde ohne Merge geschlossen. Offendocumentation
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 85/100
github/copilot-sdk#2758 ·
Alle Issues in github/copilot-sdk
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
ls1intum/thesis-management#1473 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
LunaDeerMC/Dominion#301 · 1 Kommentar ·
-
[FEATURE] Expose external refresh, node-level translog and warmer statsEvtl. vergeben Ein verknüpfter Pull Request ist offen oder bereits gemergt. Offenuntriaged
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
opensearch-project/opensearch-prometheus-exporter#680 ·
Maintainer antworten meist innerhalb von 2 Tagen
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 85/100
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 66/100
Maintainer antworten meist innerhalb von 2 Tagen