node.js - 限制 node.js 的内存使用

标签 node.js memory ram

我试图限制 node.js 应用程序使用大量内存,我发现了 --max-stack-size--max_executable_size 在调用文件时可以在 V8 中传递的选项,但是我应该如何结合这些和可能的其他参数来将最大内存使用量限制为 1GB?

最佳答案

https://github.com/joyent/node/wiki/FAQ

What is the memory limit on a node process?

Currently, by default v8 has a memory limit of 512mb on 32-bit systems, and 1gb on 64-bit systems. The limit can be raised by setting --max_old_space_size to a maximum of ~1gb (32-bit) and ~1.7gb (64-bit), but it is recommended that you split your single process into several workers if you are hitting memory limits.

我相信值(value)是以兆字节为单位的。

关于node.js - 限制 node.js 的内存使用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12779724/

相关文章:

java - 按程序生成一个巨大的宇宙

python - FFMPEG - 图像到视频。来自 RAM 的图像? (Python)

Javascript、ajax 和内存使用

javascript - 创建在后台与 Promises 一起使用的 EventEmitter 的正确方法

javascript - http.get - 下载后文件损坏

node.js - 将创作的 yeoman 生成器的更新应用到 npm 全局安装/更新

Java 应用程序内存使用情况

javascript - 取消订阅 RxJS Observables

c++ - 如何确定对象的对齐方式

c - 一个包含很多功能的程序如何存储在一个文本段中?