--heap-prof


在启动时开始 V8 堆分析器,并在退出前将堆分析器写入磁盘。

¥Starts the V8 heap profiler on start up, and writes the heap profile to disk before exit.

如果未指定 --heap-prof-dir,则生成的分析文件放在当前工作目录中。

¥If --heap-prof-dir is not specified, the generated profile is placed in the current working directory.

如果未指定 --heap-prof-name,则生成的分析文件名为 Heap.${yyyymmdd}.${hhmmss}.${pid}.${tid}.${seq}.heapprofile

¥If --heap-prof-name is not specified, the generated profile is named Heap.${yyyymmdd}.${hhmmss}.${pid}.${tid}.${seq}.heapprofile.

$ node --heap-prof index.js
$ ls *.heapprofile
Heap.20190409.202950.15293.0.001.heapprofile