Skip to content

fix: memory leak in telemetry reporter - #1137

Open
Simon Siefke (SimonSiefke) wants to merge 3 commits into
microsoft:mainfrom
SimonSiefke:fix/memory-leak-telemetryReporter
Open

Simon Siefke (SimonSiefke) wants to merge 3 commits into
microsoft:mainfrom
SimonSiefke:fix/memory-leak-telemetryReporter

Conversation

@SimonSiefke

Copy link
Copy Markdown

Details

Each debugger telemetry event creates a reporter because the reporter returned by the factory is never saved. The reporters are not disposed when the extension deactivates.

Change

Reuse the cached reporter for subsequent events, and dispose it during extension deactivation.

Before

When starting and stopping a Flask debug session 17 times, telemetry loggers and their callbacks in the extension host grow by 119:

before

After

No more leak detected.

Test Video

video.webm

AI disclosure: Model: GPT 6.1 Sol. Worktime: 12 min

Comment thread src/extension/telemetry/index.ts Resolved
Comment thread src/extension/telemetry/reporter.ts Resolved

@rchiodo Rich Chiodo (rchiodo) left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@rchiodo Rich Chiodo (rchiodo) added the bug Issue identified by VS Code Team member as probable bug label Nov 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Issue identified by VS Code Team member as probable bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants