microsoft / microsoft/TypeScript
Bug Report: Severe memory leak triggered by "TypeScript (Native Preview)" extension
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 111k
- Forks
- 14.3k
- Avg merge
- 2d 4h
- Merged PRs (30d)
- 132
Description
🔎 Search Terms
Note: this issue is updated version of https://github.com/microsoft/TypeScript/issues/63849
🕗 Version & Regression Information
Extension identifier: typescriptteam.native-preview
Extension version: 0.20260708.2
VS Code Version: 1.134
Operating system Version: Ubuntu 22.04
The bug reproduces with and without the "TypeScript 7 Nightly" extension
Identifier: typescriptteam.vscode-typescript-nightly
Version: 0.20260826.1
I used this extension to have the latest version of TypeScript (with TypeScript: Select TypeScript Version -> Use TypeScript 7).
⏯ Playground Link
No response
💻 Code
Steps to reproduce
- Create a new empty folder and create a single blank file named
index.tsinside it. It is important to have many other git repositories nearby (e.g.../*). - Disable the "TypeScript (Native Preview)" extension in VS Code.
- Open the newly created folder in VS Code.
- Open the
index.tsfile (this step is required to trigger the behavior). - Check the system monitor: memory consumption remains normal/baseline (~4.1 GB total system load).
- Enable the "TypeScript (Native Preview)" extension.
- Observe the system monitor: memory consumption starts growing rapidly.
- Disable the extension and run the "Restart Extensions" command (do not close VS Code yet).
- Observe that the memory leak continues unabated (climbing up to ~14.6 GB / 87.5% RAM usage).
- Close VS Code completely: the memory leak stops.
Important clarification: When I add the default package.json file to the folder using the following command, there is no memory leak.
npm init -y
🙁 Actual behavior
Memory usage spikes dramatically and is never reclaimed until the entire VS Code application is shut down.
Screenshots
- Baseline / Normal state (~4.1 GB):
- Leaked state (~14.6 GB after enabling/disabling the extension):
🙂 Expected behavior
Enabling the extension on an empty file should not cause massive memory consumption. Disabling the extension or restarting extensions should terminate the underlying leaked processes and free up the allocated RAM.
Additional information about the issue
The CPU is also used quite actively. On the penultimate screen you can see the memory consumption curve.
The moment VS Code closes
You see a spike first - this is when VS Code is closed. And then the memory does not return to normal.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the leak with the typescriptteam.native-preview extension, a blank index.ts, and nearby Git repositories, then compare behavior after adding package.json with npm init -y. Investigate the extension's process and lifecycle behavior when it is enabled, disabled, or restarted. Done means memory remains stable and disabling or restarting extensions stops the leak without closing VS Code.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- performance, tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100