Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Heap snapshot on OOM due to buffers/external memory/large arrays rather than V8 heap

未关闭
#63,952 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
35/100
Issue 类型
功能
描述清晰度
需要澄清
活跃度
冷清

调研方向

该 issue 未指明源文件或测试。首先查看 Node 对 --heap-snapshot-on-oom 的处理以及 process.memoryUsage(),然后确定 V8 堆、Buffer、外部内存和 RSS 限制是如何表示的;要视为完成,需要针对所提议的 --max-memory 或 --max-rss 行为确定设计、完成实现并提供测试覆盖。

由索引模型根据 Issue 内容生成。

描述

feature request
What is the problem this feature will solve?

I have a server that's been OOMing when it hits the Docker memory limit I set of 2GB. I had set --max-old-space-size=432 --max-semi-space-size=16 --heap-snapshot-on-oom but Node isn't logging OOM or creating a heap snapshot so I think the issue is too much buffer allocation.

It sure sucks that there's no surefire way to get diagnostic information if too many buffers get allocated.

What is the feature you are proposing to solve the problem?

I'm not 100% sure if this is possible but a --max-memory or --max-rss flag that would set a limit on the resident set size would be really great. If V8 heap, buffer, or C++ external object allocation would push the resident set size over this limit, Node would make a heap snapshot if --heap-snapshot-on-oom is set, and then exit.

What alternatives have you considered?

I will have to try polling process.memoryUsage() and taking my own heap dump if the memory is getting too large, but I think sudden buffer allocation is OOMing after only a few seconds so I'm not sure it will even work.

主要语言
JavaScript
星标
122k
派生
37.4k
平均合并
4 天 2 小时
30 天内合并 PR
277

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

nodejs/node 的其他 Issue

查看 nodejs/node 的全部 Issue

相似的 Issue

更多 JavaScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。