feat(cli,vscode): add memory profiling infrastructure for kilo serve#8982
Draft
marius-kilocode wants to merge 1 commit intomainfrom
Draft
feat(cli,vscode): add memory profiling infrastructure for kilo serve#8982marius-kilocode wants to merge 1 commit intomainfrom
marius-kilocode wants to merge 1 commit intomainfrom
Conversation
Add KILO_PROFILE flag gating debug HTTP endpoints and periodic memory logging on the kilo serve backend. This enables investigating memory leaks that occur when the Agent Manager is used over extended periods, particularly on Windows with large worktree diffs. - GET /global/debug/memory — current process.memoryUsage() stats - POST /global/debug/snapshot — write V8 heap snapshot to disk - POST /global/debug/gc — force GC and report before/after - 30s periodic memory logging when KILO_PROFILE=1 - --profile flag on bun run extension to enable everything
Contributor
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Files Reviewed (6 files)
Reviewed by gpt-5.4-2026-03-05 · 616,101 tokens |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Don't review this, only to profile memory issues on Windows
Summary
KILO_PROFILE=1env flag and--profileoption tobun run extensionthat enables memory profiling of thekilo servebackend process/global/debug/memory,/global/debug/snapshot,/global/debug/gc) for on-demand memory inspection and heap snapshot capturepackages/kilo-vscode/docs/infrastructure/memory-profiling.mdcovering the full profiling workflow, suspected causes, and analysis techniquesThis is investigative tooling for the Windows memory leak where the Bun process accumulates multiple GB of RSS over extended Agent Manager usage with large worktree diffs. The doc describes what we know so far (RSS grows outside V8 heap, pointing to native buffer accumulation from git stdout buffering) and how to reproduce/measure it.