diff options
author | Joyee Cheung <joyeec9h3@gmail.com> | 2019-04-23 11:47:28 +0800 |
---|---|---|
committer | Anna Henningsen <anna@addaleax.net> | 2019-05-26 22:18:00 +0200 |
commit | 4b74dae6b2601ee8be3b16fed48986f1be49f20a (patch) | |
tree | d9dde6a3876ade51a6857cf46b242ea59ce9e5ef /doc | |
parent | e2c0c0c68074c539ae2ae30debdeafb9f94d989b (diff) | |
download | android-node-v8-4b74dae6b2601ee8be3b16fed48986f1be49f20a.tar.gz android-node-v8-4b74dae6b2601ee8be3b16fed48986f1be49f20a.tar.bz2 android-node-v8-4b74dae6b2601ee8be3b16fed48986f1be49f20a.zip |
inspector: implement --heap-prof
In addition implements --heap-prof-name, --heap-prof-dir and
--heap-prof-interval.
These flags are similar to --cpu-prof flags but they are meant
for the V8 sampling heap profiler instead of the CPU profiler.
PR-URL: https://github.com/nodejs/node/pull/27596
Fixes: https://github.com/nodejs/node/issues/27421
Reviewed-By: Jan Krems <jan.krems@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Diffstat (limited to 'doc')
-rw-r--r-- | doc/api/cli.md | 51 | ||||
-rw-r--r-- | doc/node.1 | 22 |
2 files changed, 73 insertions, 0 deletions
diff --git a/doc/api/cli.md b/doc/api/cli.md index e76a3296f0..3dbb230c87 100644 --- a/doc/api/cli.md +++ b/doc/api/cli.md @@ -245,6 +245,57 @@ new X(); added: v12.0.0 --> +### `--heap-prof` +<!-- YAML +added: REPLACEME +--> + +> Stability: 1 - Experimental + +Starts the V8 heap profiler on start up, and writes the heap profile to disk +before exit. + +If `--heap-prof-dir` is not specified, the generated profile will be placed +in the current working directory. + +If `--heap-prof-name` is not specified, the generated profile will be +named `Heap.${yyyymmdd}.${hhmmss}.${pid}.${tid}.${seq}.heapprofile`. + +```console +$ node --heap-prof index.js +$ ls *.heapprofile +Heap.20190409.202950.15293.0.001.heapprofile +``` + +### `--heap-prof-dir` +<!-- YAML +added: REPLACEME +--> + +> Stability: 1 - Experimental + +Specify the directory where the heap profiles generated by `--heap-prof` will +be placed. + +### `--heap-prof-interval` +<!-- YAML +added: REPLACEME +--> + +> Stability: 1 - Experimental + +Specify the average sampling interval in bytes for the heap profiles generated +by `--heap-prof`. The default is 512 * 1024 bytes. + +### `--heap-prof-name` +<!-- YAML +added: REPLACEME +--> + +> Stability: 1 - Experimental + +Specify the file name of the heap profile generated by `--heap-prof`. + Generates a heap snapshot each time the process receives the specified signal. `signal` must be a valid signal name. Disabled by default. diff --git a/doc/node.1 b/doc/node.1 index 13aa94ff38..7349b63568 100644 --- a/doc/node.1 +++ b/doc/node.1 @@ -139,6 +139,28 @@ Enable experimental frozen intrinsics support. .It Fl -heapsnapshot-signal Ns = Ns Ar signal Generate heap snapshot on specified signal. . +.It Fl -heap-prof +Start the V8 heap profiler on start up, and write the heap profile to disk +before exit. If +.Fl -heap-prof-dir +is not specified, the profile will be written to the current working directory +with a generated file name. +. +.It Fl -heap-prof-dir +The directory where the heap profiles generated by +.Fl -heap-prof +will be placed. +. +.It Fl -heap-prof-interval +The average sampling interval in bytes for the heap profiles generated by +.Fl -heap-prof . +The default is +.Sy 512 * 1024 . +. +.It Fl -heap-prof-name +File name of the V8 heap profile generated with +.Fl -heap-prof +. .It Fl -http-parser Ns = Ns Ar library Chooses an HTTP parser library. Available values are .Sy llhttp |