Fix Dashboard memory leaks on tab close (#835)#836
Merged
erikdarlingdata merged 1 commit intodevfrom Apr 14, 2026
Merged
Conversation
… on tab close (#835) Dashboard had the same memory leak patterns fixed in Lite (commit 2b61592) but never received those fixes. When server tabs were closed, 53+ event handlers and hover helpers remained subscribed, preventing GC from collecting the tab and its child controls. - Add Dispose() to Dashboard ChartHoverHelper (matches Lite) - Add DisposeChartHelpers() to ServerTab, MemoryContent, ResourceMetricsContent, and QueryPerformanceContent - Store lambda event delegates as named fields so they can be unsubscribed - Unsubscribe all child control events in ServerTab_Unloaded (slicers, CriticalIssuesTab, MemoryTab, PerformanceTab, ResourceMetricsContent) - Store and unsubscribe AlertAcknowledged handler in MainWindow.CloseTab_Click - Clear unfiltered data collections, filter dictionaries, legend panels, and baseline provider cache on tab close Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.
Summary
Dispose()to Dashboard'sChartHoverHelperto unsubscribe mouse event handlersDisposeChartHelpers()toServerTab,MemoryContent,ResourceMetricsContent, andQueryPerformanceContent— disposes all 53+ hover helpers when tabs closeServerTabso they can be unsubscribed inUnloadedAlertAcknowledgedhandler inMainWindow.CloseTab_ClickContext
Issue #835 reports Dashboard memory growing to 4GB and never releasing. The prior memory fixes (#758, #762, #792) all targeted Lite's DuckDB layer. The Dashboard (WPF/SQL Server) had the same event handler and chart helper leak patterns but was never addressed.
Test plan
🤖 Generated with Claude Code