Change:
<!-- Do Not Delete This! bugreporttemplate --<!-- Please read our Rules of Conduct: --<!-- Read our guide about submitting issues: --<!-- Search existing issues to avoid creating duplicates. --<!-- Test using the latest Insiders build to see if your issue has already been fixed: --<!-- Instead of creating your report here, use 'Report Issue' from the 'Help' menu in VS Code to pre-fill useful information. --<!-- Launch with to check. --Does this issue occur when all extensions are disabled?: Yes <!-- If you answered No above, use 'Help: Start Extension Bisect' from Command Palette to try to identify the cause. --<!-- Issues caused by an extension need to be reported directly to the extension publisher. The 'Help Report Issue' dialog can assist with this. --- VS Code Version: 1.84.2 OS Version: Ubuntu 23.04 Steps to Reproduce: an editor the editor that a was created but not removed In Chrome devtools, the retainer chain points to : !
I discussed with and when an editor is closed it is not disposed unless it is the last editor in the group and the group isn't the default group, so in the scenario described in this issue, the is still expected to exist. Here's how to check if the is being leaked: an editor. Check how many s you have. a second editor in a new editor group. the editor in the second group. Check how many s you have. If there is no leak, there should be the same number as in step 1. I have tested, and I don't see a memory leak from .
Thanks a lot for the info, it's really helpful! And apologies, you're absolutely right! I was so focused looking for something that would explain the two and didn't really think about anything else. Your steps make much more sense and with that I don't see a memory leak from . No wonder it took me so long to find the apparent source, when there is none... xD Thanks again!

Discussion:
this.onModelChanged(); this.codeEditorService.registerDecorationType('comment-controller', COMMENTEDITOR_DECORATION_KEY, {}); <del> this.commentService.registerContinueOnCommentProvider({ provideContinueOnComments: () => { const pendingComments: languages.PendingCommentThread[] = []; if (this._commentWidgets) { for (const zone of this._commentWidgets) { const zonePendingComments = zone.getPendingComments(); const pendingNewComment = zonePendingComments.newComment; if (!pendingNewComment) { continue; } let lastCommentBody; if (zone.commentThread.comments && zone.commentThread.comments.length) { const lastComment = zone.commentThread.comments[zone.commentThread.comments.length - 1]; if (typeof lastComment.body === 'string') { lastCommentBody = lastComment.body; } else { lastCommentBody = lastComment.body.value; </del> <ins> this.globalToDispose.add( this.commentService.registerContinueOnCommentProvider({ provideContinueOnComments: () => { const pendingComments: languages.PendingCommentThread[] = []; if (this._commentWidgets) { for (const zone of this._commentWidgets) { const zonePendingComments = zone.getPendingComments(); const pendingNewComment = zonePendingComments.newComment; if (!pendingNewComment) { continue; } let lastCommentBody; if (zone.commentThread.comments && zone.commentThread.comments.length) { const lastComment = zone.commentThread.comments[zone.commentThread.comments.length - 1]; if (typeof lastComment.body === 'string') { lastCommentBody = lastComment.body; } else { lastCommentBody = lastComment.body.value; } </ins> } <del> } if (pendingNewComment !== lastCommentBody) { pendingComments.push({ owner: zone.owner, uri: zone.editor.getModel()!.uri, range: zone.commentThread.range, body: pendingNewComment, isReply: (zone.commentThread.comments !== undefined) && (zone.commentThread.comments.length > 0) }); </del> <ins> if (pendingNewComment !== lastCommentBody) { pendingComments.push({ owner: zone.owner, uri: zone.editor.getModel()!.uri, range: zone.commentThread.range, body: pendingNewComment, isReply: (zone.commentThread.comments !== undefined) && (zone.commentThread.comments.length > 0) }); } </ins> } } <ins> return pendingComments; </ins> } <del> return pendingComments; } }); </del> <ins> }) ); </ins> } private registerEditorListeners() {