Skip to content

Integrated terminal leaks GPU memory #152300

@SvanT

Description

@SvanT

Issue Type: Performance Issue

Terminals doesn't seem to free all GPU memory when closing them, making alt-tabbing from another application to vscode slower over time, there are other tickets around vscode freezing when alt-tabbing back to it and this seems to be one of the reasons as Windows needs to load/unload 1GB+ of GPU memory when alt-tabbing occurs.

One way of reproducing this:

  1. Open 20 integrated terminals
  2. Close the terminals again (now only welcome screen open)
  3. Open Windows task manager -> Performance tab
  4. When something covers vscode completely (i.e. task manager is maximized) the GPU memory usage is 500MB+ lower than if vscode is visible (i.e. task manager is not maximized so it doesn't cover vscode completely, forcing Windows to keep vscode GPU memory active).
  5. This scales linearly if you open more terminals, i.e. 40 terminals keeps 1GB+ of GPU memory even when they are closed

I can reproduce it on the insiders build as well, so Electron 18 doesn't seem to solve this issue.

vscode visible (2 GB GPU memory usage at the bottom of the screenshot):
image

vscode still open but behind other windows (1 GB GPU memory usage at the bottom of the screenshot):
image

VS Code version: Code 1.68.1 (30d9c6c, 2022-06-14T12:48:58.283Z)
OS version: Windows_NT x64 10.0.22000
Restricted Mode: No
Remote OS version: Linux x64 5.10.102.1-microsoft-standard-WSL2

System Info
Item Value
CPUs 11th Gen Intel(R) Core(TM) i7-1185G7 @ 3.00GHz (8 x 2995)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
oop_rasterization: enabled
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_renderer: enabled_on
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
Load (avg) undefined
Memory (System) 31.85GB (17.42GB free)
Process Argv --crash-reporter-id b4b9a369-6b96-42a6-95ce-cc35e92e4ee0
Screen Reader no
VM 33%
Item Value
Remote WSL: Ubuntu
OS Linux x64 5.10.102.1-microsoft-standard-WSL2
CPUs 11th Gen Intel(R) Core(TM) i7-1185G7 @ 3.00GHz (8 x 2995)
Memory (System) 15.55GB (11.62GB free)
VM 0%

Metadata

Metadata

Assignees

Labels

author-verification-requestedIssues potentially verifiable by issue authorbugIssue identified by VS Code Team member as probable buginsiders-releasedPatch has been released in VS Code Insidersperfterminal-renderingupstreamIssue identified as 'upstream' component related (exists outside of VS Code)verifiedVerification succeeded

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions