Skip to content

Conversation

@SimonSiefke
Copy link
Contributor

Before (Typing in editor 197 times):

Untitled

When typing into the editor 197 times, it seems that the number of QuickDiffModel functions increases by one each time.


The json lists src/vs/workbench/contrib/scm/browser/quickDiffModel.ts:232:10 as source:

this._diffDelayer
	.trigger(async () => {
		const result: { allChanges: QuickDiffChange[]; changes: QuickDiffChange[]; mapChanges: Map<string, number[]> } | null = await this.diff();

		const editorModels = Array.from(this._originalEditorModels.values());
		if (!result || this._disposed || this._model.isDisposed() || editorModels.some(editorModel => editorModel.isDisposed())) {
			return; // disposed
		}

		this.setChanges(result.allChanges, result.changes, result.mapChanges);
	})
	.catch(err => onUnexpectedError(err)); // here

After registering the _diffDelayer disposable, the issue seems to be resolved.


JSON Data Details
{
  "namedFunctionCount3": [
    {
      "count": 203,
      "delta": 203,
      "name": "anonymous",
      "sourceLocation": "vscode-file://vscode-app/workspace/vscode-memory-leak-finder/.vscode-test/vscode-linux-x64-1.103.2/resources/app/out/vs/workbench/workbench.desktop.main.js:569:18762",
      "originalLocation": "src/vs/workbench/contrib/comments/browser/commentsController.ts:710:11",
      "originalName": "CommentController.beginComputeCommentingRanges"
    },
    {
      "count": 203,
      "delta": 203,
      "name": "anonymous",
      "sourceLocation": "vscode-file://vscode-app/workspace/vscode-memory-leak-finder/.vscode-test/vscode-linux-x64-1.103.2/resources/app/out/vs/workbench/workbench.desktop.main.js:569:18902",
      "originalLocation": "src/vs/workbench/contrib/comments/browser/commentsController.ts:715:7",
      "originalName": "CommentController.beginComputeCommentingRanges"
    },
    {
      "count": 203,
      "delta": 203,
      "name": "anonymous",
      "sourceLocation": "vscode-file://vscode-app/workspace/vscode-memory-leak-finder/.vscode-test/vscode-linux-x64-1.103.2/resources/app/out/vs/workbench/workbench.desktop.main.js:430:48674",
      "originalLocation": "src/vs/editor/contrib/folding/browser/folding.ts:344:23",
      "originalName": "unknown"
    },
    {
      "count": 203,
      "delta": 203,
      "name": "anonymous",
      "sourceLocation": "vscode-file://vscode-app/workspace/vscode-memory-leak-finder/.vscode-test/vscode-linux-x64-1.103.2/resources/app/out/vs/workbench/workbench.desktop.main.js:527:23529",
      "originalLocation": "src/vs/workbench/contrib/scm/browser/quickDiffModel.ts:232:10",
      "originalName": "QuickDiffModel"
    }
  ],
  "isLeak": true
}
@vs-code-engineering vs-code-engineering bot added this to the August 2025 milestone Sep 3, 2025
Copy link
Contributor

@DonJayamanne DonJayamanne left a comment

Choose a reason for hiding this comment

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

Wait, I think i may have been too quick
Let me have another look

Copy link
Contributor

@DonJayamanne DonJayamanne left a comment

Choose a reason for hiding this comment

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

Yes its fine, i had to have another look as we already do some disposing work in the dispose method (line 500).
However we will first cancel this ThrottleDelayer and then dispose of it, hence its fine.

@DonJayamanne DonJayamanne merged commit 7159105 into microsoft:main Sep 3, 2025
17 checks passed
@vs-code-engineering vs-code-engineering bot locked and limited conversation to collaborators Oct 18, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

3 participants