Skip to content

Memory leak in InlineEditsGutterIndicator #273549

@yavanosta

Description

@yavanosta

Does this issue occur when all extensions are disabled?: Yes

  • VS Code Version: 1.105.1
  • OS Version: MacOS 15.7.1

Steps to Reproduce:

  1. Open VSCode
  2. Make sure that you have code suggestions enabled
  3. Work some time normally, make sure that you see edit suggestions from time to time
  4. Run this line in developer console document.querySelectorAll('[widgetid*="observablePositionWidget"]').length
  5. Notice that every time you have an edit suggestion you have one new permanent observalbePositionWidget created which is never removed.

Problem description.

  1. The core problem is in this code snippet.
  2. InlineEditsGutterIndicator is instantiated effectively only once for each editor and then reused.
  3. Every time range is changed a new observable is created by this._editorObs.observeLineOffsetRange
  4. While this observables are correctly kept in this this._store they will be cleaned up only when editor is disposed
  5. It means that if one works long enough and has many inline edit suggestions, they can have hundreds if not thousands of dom nodes which are effectively not used anymore.

Metadata

Metadata

Assignees

Labels

bugIssue identified by VS Code Team member as probable buginline-completionsinsiders-releasedPatch has been released in VS Code InsidersverifiedVerification succeeded

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions