Rust bundled runtime installation retains large native-image buffers on cold and warm startup
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 55/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- node.js, rust
- Ambito
- performance, tooling
Direzione di ricerca
Inizia dal punto di ingresso del Rust SDK install_bundled_runtime(), quindi segui install_hostless_assets e la gestione di runtime.node da parte di install_runtime_pair. Esegui le riproduzioni isolate a freddo e a caldo con dati iniziali descritte nell’issue, inclusi file corrotti e troncati. Il lavoro è completato quando l’estrazione e la verifica vincolate preservano i byte e le modalità, le cache valide di sola lettura rimangono utilizzabili, i file corrotti vengono riparati atomicamente e le misurazioni coprono i casi a freddo, a caldo e di riparazione.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Description
The Rust SDK's install_bundled_runtime() path allocates complete runtime archive entries and reads installed files into full-size buffers. install_hostless_assets handles runtime.node, then install_runtime_pair extracts and compares it again. On macOS, those allocations can leave substantial physical memory retained by the allocator even after the installer returns, including when every installed file is already valid.
This is an installer-only reproduction, not evidence of a live-object leak or a measurement of a client/model session. No authentication, CLI subprocess or service request is needed.
Reproduction
At SDK revision a675b55531a9dfc647ee015e32d74279568550f3, build a release Rust executable with default bundled-cli features which calls github_copilot_sdk::install_bundled_runtime() once and stays alive for one second afterward. Run the executable with a fresh isolated HOME. For the warm case, first seed that same home's SDK cache using a separate process, then run the measured executable in a new process. Do not reuse the same process, because its OnceLock bypasses installation.
Measure process-lifetime peak RSS/physical footprint with macOS /usr/bin/time -l, and current RSS/physical footprint using proc_pid_rusage(RUSAGE_INFO_V0) after the one-second idle period. Keep allocation-stack logging disabled in these measurements.
Observed SDK-only baseline
Apple M4 Pro, 48 GiB RAM, macOS 26.6.2 (25G83), arm64; rustc 1.94.0; release optimization level 3, debug level 1. Public bundled runtime 1.0.84-8. Five independent processes per cohort; medians (minimum-maximum):
| Cohort | Retained physical footprint, MiB | Installer seconds |
|---|---|---|
| Cold installation | 155.438 (154.563-156.047) | 0.880 (0.863-1.037) |
| Valid warm installation | 174.360 (172.735-174.907) | 1.031 (0.997-1.092) |
The installed runtime.node is 71,166,736 bytes, SHA-256 839cd681c72cb92f27697d5e3e3ee96d7bb8df4234ffb5f7b442956828ec173a. Filtered embedded runtime archive SHA-256: 6c43b789080fc06b25d406af8fae709daa99f0724c4d290cc8a31160c5a3ad64.
A separate instrumented warm process recorded two page-rounded 71,172,096-byte VM allocations through the SDK runtime installer, one also through std::fs::read; after installation, vmmap reported 165.7 MiB in MALLOC_LARGE (empty) regions. Instrumented values are excluded from the comparison above.
Expected behavior
Runtime extraction and existing-file verification should use bounded buffers, preserve exact output bytes/modes, permit valid read-only warm caches, and repair corrupt files with staged atomic replacement. The full CLI installer is a separate path and outside the memory optimization scope.
A focused fix with runnable reproduction and cold/warm/corrupt/truncated measurements is prepared.
- Lingua principale
- Java
- Stelle
- 10.5k
- Fork
- 1.5k
- Merge medio
- 1g 9h
- PR unite (30g)
- 130
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di github/copilot-sdk
-
agentic-workflows
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
github/copilot-sdk#2760 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
github/copilot-sdk#2759 ·
-
documentation
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 85/100
github/copilot-sdk#2758 ·
-
agentic-workflows
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
github/copilot-sdk#2709 · 1 commento ·
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 78/100
github/copilot-sdk#2673 ·
Tutte le issue di github/copilot-sdk
Issue simili
-
executions.Query — startDate and timeRange filters are sent with inverted comparison operators Apertaarea/plugin
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
kestra-io/plugin-kestra#190 ·
-
litertlm-android AAR ships no consumer ProGuard rules → "mid == null" SIGABRT in minified apps Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
google-ai-edge/LiteRT-LM#3739 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
integra-team-red/meet-map#249 ·
-
[Studio][Bug] Cancelled create-user dialog keeps the password and admin switch for the next attempt Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
apache/rocketmq-dashboard#5064 ·
-
Consent portal: creating a duplicate Purpose shows a generic error instead of "already exists" Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
wso2/dpdp-accelerator#287 ·