代码之家  ›  专栏  ›  技术社区  ›  Vishnu Prabhakaran

检查node.js中分配的最大内存大小

  •  1
  • Vishnu Prabhakaran  · 技术社区  · 6 年前

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

    1 回复  |  直到 6 年前
        1
  •  2
  •   Anshul Verma    6 年前

    你可以用 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