Skip to content

Perf: fix long-session leaks in both apps (P4)#1116

Merged
erikdarlingdata merged 1 commit into
devfrom
feature/perf-leaks
Jun 12, 2026
Merged

Perf: fix long-session leaks in both apps (P4)#1116
erikdarlingdata merged 1 commit into
devfrom
feature/perf-leaks

Conversation

@erikdarlingdata

Copy link
Copy Markdown
Owner

Long-session leak fixes in both apps (P4) — these progressively degrade responsiveness over a multi-hour/day session.

  • Dashboard AlertsHistoryContent: 10s DispatcherTimer started in ctor, never stopped → closing the Alerts tab leaked the whole control per open/close and kept ticking. Added Cleanup() from CloseTab_Click.
  • Dashboard _lastLongRunningJobAlert: per-run keys never pruned (Lite already had this); now prunes aged-out entries.
  • Lite SystemTrayService: Initialize re-runs on theme change and re-subscribed StateChanged without removing the old handler; now -= first.
  • Lite plan viewers: closing a server tab with plan tabs open leaked each PlanViewerControl via the static ThemeChanged event; DisposeChartHelpers now cleans them up.

Build: solution clean (net10); Dashboard.Tests 482/482.

Flagged (design approval): Lite DeltaCalculator accumulates dead plan_handle keys for the session. Correct fix = retain only keys seen each collection pass; getting it wrong evicts live deltas → false spikes, so I want your nod before touching the collector path.

🤖 Generated with Claude Code

- Dashboard AlertsHistoryContent started a 10s DispatcherTimer in its ctor that
  was never stopped, so closing the Alerts tab leaked the whole control (and its
  alert list) per open/close and kept ticking forever. Added Cleanup(), called
  from CloseTab_Click.
- Dashboard _lastLongRunningJobAlert is keyed per job run and was never pruned
  (Lite already got this fix); now prunes aged-out entries each pass.
- Lite SystemTrayService.Initialize re-runs on theme change and re-subscribed
  MainWindow.StateChanged without removing the old handler, stacking duplicates;
  now unsubscribes first.
- Lite: closing a server tab with plan tabs still open leaked each
  PlanViewerControl via the static ThemeChanged event (ClosePlanTab_Click only
  covered the per-tab close button); DisposeChartHelpers now cleans them up.

Build: solution clean (net10); Dashboard.Tests 482/482.

Flagged (needs design approval): Lite DeltaCalculator accumulates dead plan_handle
keys for the session. The correct fix retains only the live keys seen each
collection pass (the DMV result is the full live plan cache) — getting it wrong
evicts live deltas and causes false delta spikes, so I want your nod on the
approach before touching the collector path.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@erikdarlingdata erikdarlingdata merged commit f135278 into dev Jun 12, 2026
@erikdarlingdata erikdarlingdata deleted the feature/perf-leaks branch June 12, 2026 03:46
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