Repository navigation
Closed
Labels
author-verification-requestedIssues potentially verifiable by issue authorbugIssue identified by VS Code Team member as probable bugconfirmedIssue has been confirmed by VS Code Team memberinsiders-releasedPatch has been released in VS Code InsidersterminalGeneral terminal issues that don't fall under another labelverifiedVerification succeeded
Milestone
Description
- VSCode Version: 1.51.1
- OS Version: Darwin x64 19.6.0
Steps to Reproduce:
- Open a terminal
- Type in the following: while true; do echo test; done
- Observe memory consumption: it will increase, and eventually the VS Code will die with a OOM
Does this issue occur when all extensions are disabled?: No
I investigated why it happened, and root caused it to a memory leak in xterm.js
- xterm.js has experimental buffer API here: https://github.com/xtermjs/xterm.js/blob/5cb048094e23da22ccfe46666b87d1ad427dce6d/src/browser/public/Terminal.ts#L61
- In the above line BufferNamespaceApi is created
- In the constructor of it, BufferNamepsaceApi created a listener: https://github.com/xtermjs/xterm.js/blob/5cb048094e23da22ccfe46666b87d1ad427dce6d/src/browser/public/Terminal.ts#L251 But this listener never gets removed
- .buffer is called all over the place in terminal support, thus leaking memory
It's possible to work around this issue by getting a buffer once, on xterm object creation, and using this object instead of a terminal.buffer. I checked, and it fixed the above problem. The memory consumption is stable, and vs code doesn't die.
Metadata
Metadata
Assignees
Labels
author-verification-requestedIssues potentially verifiable by issue authorbugIssue identified by VS Code Team member as probable bugconfirmedIssue has been confirmed by VS Code Team memberinsiders-releasedPatch has been released in VS Code InsidersterminalGeneral terminal issues that don't fall under another labelverifiedVerification succeeded
Activity
meganrogge commentedon Dec 17, 2020
I'm not seeing this happen in local VS code windows - only remote. Is that what you're seeing too Konstantin Solomatov (@solomatov) ?
solomatov commentedon Dec 17, 2020
Megan Rogge (@meganrogge) I had it in both cases, but in case of the remote it was showing much faster, but your version, and configuration is likely different from mine.
meganrogge commentedon Jan 4, 2021
fixing this upstream in Xterm.js and tweaked in this one
github-actions commentedon Jan 27, 2021
This bug has been fixed in to the latest release of VS Code Insiders!
Konstantin Solomatov (@solomatov), you can help us out by confirming things are working as expected in the latest Insiders release. If things look good, please leave a comment with the text
/verifiedto let us know. If not, please ensure you're on version 1a9dd75 of Insiders (today's or later - you can useHelp: Aboutin the command palette to check), and leave a comment letting us know what isn't working as expected.Happy Coding!