Repository navigation
Commit 2836fda
fix(monitor): stop leaking Process handles in system_stats
system_stats() backs the status-footer RSS/CPU indicators and is polled
every 2 s from the frontend. It called sys.refresh_all(), which enumerates
every process on the system and OpenProcess-es each one. On a terminal that
constantly spawns short-lived processes, those Process handles leaked
steadily, growing nonpaged pool until the machine ran out of memory and the
UI froze after several hours of uptime.
We only need our own process's RSS + CPU, so scope the refresh to our pid
via refresh_processes(ProcessesToUpdate::Some(&[pid]), true) — matching the
memory-breadcrumb loop. No handle leak, and far cheaper per poll.
Bump version to 1.1.4.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent 9c7c4aa commit 2836fda
4 files changed
Lines changed: 11 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
36 | | - | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
37 | 43 | | |
38 | 44 | | |
39 | 45 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| |||
0 commit comments