microsoft / microsoft/TypeScript
Bug Report: Severe memory leak triggered by "TypeScript (Native Preview)" extension
まだ誰も着手していません。
- 主要言語
- Go
- スター
- 111k
- フォーク
- 14.3k
- 平均マージ
- 2日 4時間
- マージ済み PR(30日)
- 132
説明
### 🔎 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
1. Create a new empty folder and create a single blank file named `index.ts` inside it. **It is important to have many other git repositories nearby (e.g. `../*`).**
2. Disable the "TypeScript (Native Preview)" extension in VS Code.
3. Open the newly created folder in VS Code.
4. Open the `index.ts` file (this step is required to trigger the behavior).
5. Check the system monitor: memory consumption remains normal/baseline (~4.1 GB total system load).
6. Enable the "TypeScript (Native Preview)" extension.
7. Observe the system monitor: memory consumption starts growing rapidly.
8. Disable the extension and run the "Restart Extensions" command (do not close VS Code yet).
9. Observe that the memory leak continues unabated (climbing up to ~14.6 GB / 87.5% RAM usage).
10. 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.
```bash
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.
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
まず、`typescriptteam.native-preview` 拡張機能、空の `index.ts`、近くにある Git リポジトリを使ってリークを再現し、`npm init -y` で `package.json` を追加した後の挙動を比較します。拡張機能を有効化、無効化、または再起動したときのプロセスとライフサイクルの挙動を調査します。VS Code を閉じずに、メモリが安定したままになり、拡張機能の無効化または再起動によってリークが止まれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- typescript
- 領域
- performance, tooling
- issue の種類
- バグ
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 活発
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 45/100