Skip to content

Commit

Permalink
doc: add information for heap snapshot flag
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
tstirrat15 authored and targos committed Jul 22, 2019
1 parent 8fe9ca4 commit 06991cd
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions doc/api/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 06991cd

Please sign in to comment.