Detecting memory leaks through shared function context
还没有人认领这个 Issue。
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 25/100
- Issue 类型
- 功能
- 描述清晰度
- 需要澄清
- 活跃度
- 停滞
- 技术栈
- javascript, nodejs
调研方向
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 内容生成。
描述
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
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
nodejs/diagnostics 的其他 Issue
-
难度 1/5 1 小时以内 新手友好度 65/100
nodejs/diagnostics#648 · 3 条评论 ·
-
难度 1/5 1 小时以内 新手友好度 20/100
nodejs/diagnostics#690 · 1 个 reaction ·
-
难度 1/5 1 小时以内 新手友好度 20/100
nodejs/diagnostics#689 ·
-
难度 1/5 1 小时以内 新手友好度 25/100
nodejs/diagnostics#688 ·
-
难度 5/5 一周以上 新手友好度 25/100
nodejs/diagnostics#687 ·
查看 nodejs/diagnostics 的全部 Issue
相似的 Issue
-
ai-generated
难度 2/5 1-3 小时 新手友好度 78/100
-
难度 2/5 1-3 小时 新手友好度 85/100
-
难度 2/5 1-3 小时 新手友好度 88/100
stratum-mining/sv2-apps#886 ·
-
bug
难度 2/5 1-3 小时 新手友好度 86/100
-
难度 2/5 1-3 小时 新手友好度 87/100