summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTanner Stirrat <tstirrat@gmail.com>2019-07-18 13:36:12 -0600
committerMichaƫl Zasso <targos@protonmail.com>2019-07-22 21:20:41 +0200
commit06991cd9023b8e00989d3b78844274deebd14b45 (patch)
tree7dd4c795e460fb8a65a6ea510f8a4be22b1e7042
parent8fe9ca416dabd6939103e240b2b97c9ff9bac2c6 (diff)
downloadandroid-node-v8-06991cd9023b8e00989d3b78844274deebd14b45.tar.gz
android-node-v8-06991cd9023b8e00989d3b78844274deebd14b45.tar.bz2
android-node-v8-06991cd9023b8e00989d3b78844274deebd14b45.zip
doc: add information for heap snapshot flag
It's nice to have usage examples, especially since the flag requires the `SIG` version of the signal name, unlike `kill`. PR-URL: https://github.com/nodejs/node/pull/28754 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
-rw-r--r--doc/api/cli.md13
1 files changed, 13 insertions, 0 deletions
diff --git a/doc/api/cli.md b/doc/api/cli.md
index 544a3acb16..d63749819e 100644
--- a/doc/api/cli.md
+++ b/doc/api/cli.md
@@ -223,6 +223,19 @@ reference. Code may break under this flag.
added: v12.0.0
-->
+Enables a signal handler that causes the Node.js process to write a heap dump
+when the specified signal is received.
+
+```console
+$ node --heapsnapshot-signal=SIGUSR2 index.js &
+$ ps aux
+USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
+node 1 5.5 6.1 787252 247004 ? Ssl 16:43 0:02 node --heapsnapshot-signal=SIGUSR2 index.js
+$ kill -USR2 1
+$ ls
+Heap.20190718.133405.15554.0.001.heapsnapshot
+```
+
### `--heap-prof`
<!-- YAML
added: v12.4.0