Skip to content

Delete the .NET heap graph each snapshot supersedes - #61

Merged
MelbourneDeveloper merged 2 commits into
mainfrom
fix/dotnet-superseded-heap-graphs
Nov 18, 2026
Merged

MelbourneDeveloper merged 2 commits into
mainfrom
fix/dotnet-superseded-heap-graphs

Conversation

@MelbourneDeveloper

Copy link
Copy Markdown
Collaborator

Follow-up leak review of main (6957145): four pi agents on GLM 5.3 plus a manual pass.

Leak fixed: every .NET memory/snapshot and memory/diff wrote a new heap-<session>/snapshot-<n>.heapgraph.json (about 16 MB for half a million objects) and kept it until stop. Only the latest graph is ever read by references and objectsByType, so a session polled for days grew the disk without bound.

Fix: capture deletes the graph it supersedes once the new one is kept.

Regression: tests/dotnet_e2e/graph_retention.rs runs snapshot, diff, snapshot against the real engine and fixture, asserts one graph after each step, checks that references still answer, and checks that stop removes the directory. Before the fix it failed with ["snapshot-1.heapgraph.json", "snapshot-2.heapgraph.json"].

make lint and make test pass locally on Windows.

Every memory snapshot and diff kept a new numbered heap graph (about 16 MB
each) until the session stopped, though only the latest is ever read. A
session polled for days filled the output directory. capture now deletes
the graph it replaces. [PROF-DOTNET-MEMORY]
@MelbourneDeveloper
MelbourneDeveloper merged commit 48369cd into main Nov 18, 2026
10 checks passed
@MelbourneDeveloper
MelbourneDeveloper deleted the fix/dotnet-superseded-heap-graphs branch November 18, 2026 19:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant