Vis*_*ran 4 memory process heap-memory node.js
我们可以从 node.js 的 process 对象中获取内存使用情况。如果我在启动 node.js 应用程序时设置了 --max-old-space-size,它会反映到进程内存使用中吗?在哪个进程对象的变量中,我可以获得我在 argv 中给出的最大旧空间?
您可以使用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
| 归档时间: |
|
| 查看次数: |
2761 次 |
| 最近记录: |