Skip to content

Commit 06991cd

Browse files
tstirrat15targos
authored andcommitted
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: #28754 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
1 parent 8fe9ca4 commit 06991cd

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

doc/api/cli.md

+13
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,19 @@ reference. Code may break under this flag.
223223
added: v12.0.0
224224
-->
225225

226+
Enables a signal handler that causes the Node.js process to write a heap dump
227+
when the specified signal is received.
228+
229+
```console
230+
$ node --heapsnapshot-signal=SIGUSR2 index.js &
231+
$ ps aux
232+
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
233+
node 1 5.5 6.1 787252 247004 ? Ssl 16:43 0:02 node --heapsnapshot-signal=SIGUSR2 index.js
234+
$ kill -USR2 1
235+
$ ls
236+
Heap.20190718.133405.15554.0.001.heapsnapshot
237+
```
238+
226239
### `--heap-prof`
227240
<!-- YAML
228241
added: v12.4.0

0 commit comments

Comments
 (0)