Skip to content

Conversation

@SimonSiefke
Copy link
Contributor

@SimonSiefke SimonSiefke commented Nov 23, 2023

Fixes #199043

Output with --measure event-listeners

{
  "eventListeners": [],
  "isLeak": false
}

@sandy081
Copy link
Member

Thanks for the PR. I already prepared fix for the extensionsWidgets.ts and I do not see issue for other memory leaks fixes you made here. Can you please file issue and prepare the PR accordingly.

@SimonSiefke SimonSiefke changed the title fix: memory leaks in extension list and simple find widget fix: memory leak in simple find widget Nov 24, 2023
@SimonSiefke
Copy link
Contributor Author

Thanks! I made a separate issue for the simpleFindWidget: #199043 and updated this PR.

It seems -monaco-gesturetap listeners are added when opening an extension detail view but not removed:

{
  "eventListenersWithStackTrace": [
    {
      "type": "-monaco-gesturetap",
      "description": "(e)=>this.emitter.fire(e)",
      "objectId": "-6782061013704719865.4.16307",
      "sourceMaps": [""],
      "stack": [
        "listener (vscode/out/vs/base/browser/event.js:17:23)",
        "Object.onWillAddFirstListener (vscode/out/vs/base/browser/event.js:20:53)",
        "_event (vscode/out/vs/base/common/event.js:650:60)",
        "new Sash (vscode/out/vs/base/browser/ui/sash/sash.js:241:28)",
        "new SimpleFindWidget (vscode/out/vs/workbench/contrib/codeEditor/browser/find/simpleFindWidget.js:176:36)",
        "new WebviewFindWidget (vscode/out/vs/workbench/contrib/webview/browser/webviewFindWidget.js:33:13)",
        "InstantiationService._createInstance (vscode/out/vs/platform/instantiation/common/instantiationService.js:103:28)",
        "InstantiationService.createInstance (vscode/out/vs/platform/instantiation/common/instantiationService.js:78:31)",
        "new WebviewElement (vscode/out/vs/workbench/contrib/webview/browser/webviewElement.js:298:79)",
        "new ElectronWebviewElement (vscode/out/vs/workbench/contrib/webview/electron-sandbox/webviewElement.js:47:13)",
        "InstantiationService._createInstance (vscode/out/vs/platform/instantiation/common/instantiationService.js:103:28)",
        "InstantiationService.createInstance (vscode/out/vs/platform/instantiation/common/instantiationService.js:78:31)",
        "ElectronWebviewService.createWebviewElement (vscode/out/vs/workbench/contrib/webview/electron-sandbox/webviewService.js:16:56)",
        "OverlayWebview._show (vscode/out/vs/workbench/contrib/webview/browser/overlayWebview.js:164:54)",
        "OverlayWebview.claim (vscode/out/vs/workbench/contrib/webview/browser/overlayWebview.js:110:18)",
        "ExtensionEditor.openMarkdown (vscode/out/vs/workbench/contrib/extensions/browser/extensionEditor.js:636:25)",
        "async ExtensionEditor.openDetails (vscode/out/vs/workbench/contrib/extensions/browser/extensionEditor.js:768:33)"
      ],
      "count": 42
    }
  ],
  "isLeak": true
}

@tisilent
Copy link
Contributor

Sash did not dispose. 😅

@tisilent tisilent mentioned this pull request Nov 25, 2023
@sandy081 sandy081 assigned rebornix and unassigned sandy081 Nov 27, 2023
Copy link
Member

@rebornix rebornix left a comment

Choose a reason for hiding this comment

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

Thank you for the investigation and fix!

@rebornix rebornix enabled auto-merge (squash) November 27, 2023 18:04
@rebornix rebornix merged commit abca256 into microsoft:main Nov 27, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Jan 11, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

memory leak in simpleFindWidget

5 participants