-
Notifications
You must be signed in to change notification settings - Fork 2.5k
docs(kilo-docs): add Take Heap Snapshot command documentation #9043
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
kilo-code-bot
wants to merge
1
commit into
main
Choose a base branch
from
docs/heap-snapshot-command
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
47 changes: 47 additions & 0 deletions
47
packages/kilo-docs/pages/getting-started/troubleshooting/heap-snapshot.md
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| --- | ||
| title: "Heap Snapshot" | ||
| description: "How to capture a heap snapshot for diagnosing memory issues in Kilo Code" | ||
| platform: new | ||
| --- | ||
|
|
||
| # Heap Snapshot | ||
|
|
||
| If Kilo Code is consuming excessive memory or becoming unresponsive, capturing a heap snapshot helps the team diagnose the issue. A heap snapshot records every object in memory at a single point in time and can be loaded in Chrome DevTools for analysis. | ||
|
|
||
| ## Taking a Heap Snapshot in VS Code | ||
|
|
||
| 1. **Open the Command Palette**: Press `Ctrl+Shift+P` (Windows/Linux) or `Cmd+Shift+P` (macOS) | ||
| 2. **Run the command**: Type `Kilo Code: Take Heap Snapshot` and select it | ||
| 3. **Wait for confirmation**: A notification will appear with the file path where the snapshot was saved | ||
|
|
||
| The snapshot is written to the Kilo log directory as a `.heapsnapshot` file. The filename includes the process ID and timestamp, for example: | ||
|
|
||
| ``` | ||
| heap-12345-20260416T125800000Z.heapsnapshot | ||
| ``` | ||
|
|
||
| {% callout type="info" %} | ||
| The command captures a snapshot of the **CLI backend process** (`kilo serve`), not the VS Code extension host. This is where the AI agent runtime, session management, and tool execution happen — and where memory issues most commonly occur. | ||
| {% /callout %} | ||
|
|
||
| ## Analyzing a Heap Snapshot | ||
|
|
||
| You can open the `.heapsnapshot` file in Chrome DevTools: | ||
|
|
||
| 1. Open Chrome and navigate to `chrome://inspect` | ||
| 2. Click **Open dedicated DevTools for Node** | ||
| 3. Go to the **Memory** tab | ||
| 4. Click **Load** and select the `.heapsnapshot` file | ||
|
|
||
| From there you can inspect object allocations, retained sizes, and reference chains to identify memory leaks. | ||
|
|
||
| ## Reporting a Memory Issue | ||
|
|
||
| When reporting a memory issue, include the following with your report: | ||
|
|
||
| 1. The `.heapsnapshot` file (or a summary of what you found) | ||
| 2. Steps to reproduce the high memory usage | ||
| 3. Your Kilo Code and VS Code versions | ||
| 4. The approximate time the issue started and what you were doing | ||
|
|
||
| Send reports to **[hi@kilocode.ai](mailto:hi@kilocode.ai)** or file an issue on [GitHub](https://github.com/Kilo-Org/kilocode). | ||
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SUGGESTION: The example filename doesn't match the format the implementation writes.
new Date().toISOString().replace(/[:.]/g, "")preserves the hyphens in the date portion, so readers will see2026-04-16T...rather than20260416T....