Detecting memory leaks through shared function context

オープン
#281 コメント 5 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
25/100
issue の種類
機能追加
明瞭さ
説明が足りない
活発さ
停滞
技術スタック
javascript, nodejs
領域
observability

調査の方向性

Start with the linked diagnostics-summit document and the heap-snapshot reconstruction approach described here; no repository files or tests are named. Establish how heap snapshots can identify objects retained by a shared function context, and define a reproducible result that demonstrates the detected pattern.

索引モデルが issue の本文から書いたものです。

説明

blind-spot never stale

This was discussed at the diagnostics summit, and I want to take the discussion here. The document I referred to is this, by my colleague @jakobkummerow.

The gist of the problem is:

const f = (function() {
  let a = {};
  let b = {};
  let c = ()=>a;  // forces a to be context-allocated.
  let d = ()=>b;  // forces b to be context-allocated.
  return d;  // the function context escapes and is kept alive.
})();

The object assigned to a is no longer accessible though JavaScript, but is kept alive because it is allocated onto the same context as b, which remains accessible through d.

Detecting this pattern at runtime would require the VM to keep track of additional meta-data, which does not pay off. However, we could, based on the information from a heap snapshot reconstruct missing metadata and detect this pattern.

主要言語
言語のデータがありません
スター
550
フォーク
69
PR マージ指標
30日以内にマージされた PR はありません

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

nodejs/diagnostics のほかの issue

nodejs/diagnostics の issue をすべて見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。