Skip to content

Conversation

@SimonSiefke
Copy link
Contributor

@SimonSiefke SimonSiefke commented Dec 9, 2025

Fixes a memory leak in ipc, generated by GitHub Copilot.

Before

When opening and closing an image editor 97 times, the number of ChannelClient.requestEvent functions seems to grow by 1 each time:

shapes at 25-12-09 17 49 11

{
  "namedFunctionCount3": [
    {
      "count": 297,
      "delta": 291,
      "name": "anonymous",
      "sourceLocation": "resources/app/out/vs/workbench/workbench.desktop.main.js:565:47809",
      "originalLocation": "src/vs/workbench/api/browser/mainThreadStatusBar.ts:74:32",
      "originalName": "MainThreadStatusBar.$setEntry"
    },
    {
      "count": 156,
      "delta": 97,
      "name": "onWillAddFirstListener",
      "sourceLocation": "resources/app/out/vs/workbench/workbench.desktop.main.js:560:514",
      "originalLocation": "src/vs/base/parts/ipc/common/ipc.ts:662:27",
      "originalName": "doRequest"
    },
    {
      "count": 156,
      "delta": 97,
      "name": "onDidRemoveLastListener",
      "sourceLocation": "resources/app/out/vs/workbench/workbench.desktop.main.js:560:648",
      "originalLocation": "src/vs/base/parts/ipc/common/ipc.ts:677:28",
      "originalName": "ChannelClient.requestEvent"
    },
    {
      "count": 156,
      "delta": 97,
      "name": "l",
      "sourceLocation": "resources/app/out/vs/workbench/workbench.desktop.main.js:560:723",
      "originalLocation": "src/vs/base/parts/ipc/common/ipc.ts:688:29",
      "originalName": "ChannelClient.requestEvent"
    }
  ],
  "isLeak": true
}

After

When opening and closing an image editor 97 times, the number of ChannelClient.requestEvent stays constant:

editor open

@vs-code-engineering
Copy link

vs-code-engineering bot commented Dec 9, 2025

📬 CODENOTIFY

The following users are being notified based on files changed in this PR:

@bpasero

Matched files:

  • src/vs/base/parts/ipc/common/ipc.ts

@SimonSiefke SimonSiefke marked this pull request as draft December 9, 2025 16:45
@SimonSiefke SimonSiefke marked this pull request as ready for review December 9, 2025 16:49
@mjbvz mjbvz removed their assignment Dec 9, 2025
Copy link
Member

@alexdima alexdima 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!

@alexdima alexdima enabled auto-merge (squash) December 15, 2025 21:59
@vs-code-engineering vs-code-engineering bot added this to the December / January 2026 milestone Dec 15, 2025
@alexdima alexdima merged commit 8d65970 into microsoft:main Dec 15, 2025
17 checks passed
przpl pushed a commit to przpl/vscode that referenced this pull request Dec 16, 2025
@SimonSiefke SimonSiefke deleted the fix/memory-leak-ipc branch January 15, 2026 15:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants