Excessive memory consumption when handling large bundles without source maps
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 78/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 静か
- 技術スタック
- javascript, node.js
- 領域
- devtools
調査の方向性
source-map-support.js の retrieveFile() と retrieveSourceMapURL() から始め、issue に記載されている mapSourcePosition() のキャッシュパスを追ってください。source map を持たない大きな bundle で検索を再現し、検索に失敗した後にその内容が fileContentsCache に保持されていないことを確認してください。
索引モデルが issue の本文から書いたものです。
説明
Environment:
- Node.js with source-map-support
- several large JavaScript bundles (5–7 MB each)
- no source maps available for the bundles
Problem:
When an error is thrown in a large bundle, the source-map-support library unnecessarily retains the full file contents in memory. The file is loaded solely to check for a source map, but its contents are cached even after this one‑time operation. This results in excessive memory usage, especially problematic with multiple large bundles.
Steps to reproduce:
- An error is thrown in a bundle (e.g., index.js)
Error.prepareStackTrace()is called- The call chain proceeds as follows:
wrapCallSite()→mapSourcePosition()→retrieveSourceMap("index.js")→retrieveSourceMapURL("index.js")→retrieveFile("index.js") - The default
retrieveFilehandler loads the entire index.js file from disk and stores it in thefileContentsCache(source) retrieveSourceMapURL()fails to find a source map for the filemapSourcePosition()stores an empty source map in its internal cache (source)- The full contents of index.js remain in the
fileContentsCacheindefinitely, consuming memory
Expected behavior:
File contents should be used only once to check for the presence of a source map, and then either not cached at all or discarded immediately after the check. There is no need to retain large bundle files in memory after this operation.
Actual behavior:
Large bundle files (5–7 MB) are retained in the fileContentsCache after the first error, leading to unnecessary increase in memory footprint.
Proposed solution:
Avoid caching when no source map is found: skip storing file contents in fileContentsCache if the source map lookup fails.
- 主要言語
- JavaScript
- スター
- 2.2k
- フォーク
- 221
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
evanw/node-source-map-support のほかの issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 78/100
evanw/node-source-map-support#343 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
evanw/node-source-map-support#337 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 20/100
evanw/node-source-map-support#333 ·
-
Provide esm versionオープン
難易度 4/5 3〜5日 初心者へのやさしさ 28/100
evanw/node-source-map-support#330 · コメント 2 件 · リアクション 9 件 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
evanw/node-source-map-support#328 · コメント 2 件 ·
evanw/node-source-map-support の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
-
[quality] Nothing keeps docs/skills/manifest.md in sync with docs/skills/*.md対応中かも @hivecommons-hive が今日担当しました。 オープンagent/quality hive/covered-by-pr hive/hosted-available-lke648397-260827-5n31 quality testing
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
needs verification
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
メンテナーはふだん 6 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 77/100
apache/rocketmq-dashboard#6610 ·
メンテナーはふだん 3 日以内に返信