我试图限制 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/