【问题标题】:Check the maximum memory size allocated in node.js检查 node.js 中分配的最大内存大小
【发布时间】:2018-11-15 18:25:23
【问题描述】:

我们可以从 node.js 的进程对象中获取内存使用情况。如果我在启动我的 node.js 应用程序时设置 --max-old-space-size,它会反映到进程内存使用情况中吗?在哪个进程对象的变量中,我可以获得我在 argv 中给出的最大旧空间?

【问题讨论】:

    标签: node.js memory process heap-memory


    【解决方案1】:

    您可以使用process.memoryUsage() 打印它。回复将是:
    rss: Resident Set Size, it is the total memory allocated for the process execution heapTotal: is the total size of the allocated heap heapUsed: is the actual memory used during the execution of the process

    【讨论】:

      猜你喜欢
      • 2017-04-07
      • 2023-03-03
      • 1970-01-01
      • 2023-03-20
      • 2014-04-04
      • 1970-01-01
      • 2015-05-08
      • 2020-08-07
      • 2022-11-23
      相关资源
      最近更新 更多