From 3492d063a23a58f958b50c1521a933719ac2f1b0 Mon Sep 17 00:00:00 2001 From: Tanner Stirrat Date: Thu, 18 Jul 2019 13:36:12 -0600 Subject: [PATCH 1/4] Add additional documentation 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`. --- doc/api/cli.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/doc/api/cli.md b/doc/api/cli.md index dc695baed91ca5..df887b8102b038 100644 --- a/doc/api/cli.md +++ b/doc/api/cli.md @@ -216,6 +216,18 @@ reference. Code may break under this flag. added: v12.0.0 --> +Enables a signal handler that causes the node process to write a heap dump when the specified signal is received. + +``` +$ 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` -Enables a signal handler that causes the node process to write a heap dump when the specified signal is received. +Enables a signal handler that causes the Node.js process to write a heap dump +when the specified signal is received. ``` $ node --heapsnapshot-signal=SIGUSR2 index.js & From 47fb8b48fccb51b57c7d9cd820d1524f77c0ca86 Mon Sep 17 00:00:00 2001 From: Tanner Stirrat Date: Fri, 19 Jul 2019 07:32:56 -0600 Subject: [PATCH 3/4] Add console highlighting Co-Authored-By: Rich Trott --- doc/api/cli.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/api/cli.md b/doc/api/cli.md index 9c3811fbc1822d..07a45e253c6336 100644 --- a/doc/api/cli.md +++ b/doc/api/cli.md @@ -219,7 +219,7 @@ 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 From 7e008faa61c005dfae58010f349d55e627eaa171 Mon Sep 17 00:00:00 2001 From: Tanner Stirrat Date: Fri, 19 Jul 2019 07:53:17 -0600 Subject: [PATCH 4/4] Remove trailing whitespace --- doc/api/cli.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/api/cli.md b/doc/api/cli.md index 07a45e253c6336..8a402d944579e5 100644 --- a/doc/api/cli.md +++ b/doc/api/cli.md @@ -221,7 +221,7 @@ when the specified signal is received. ```console $ node --heapsnapshot-signal=SIGUSR2 index.js & -$ ps aux +$ 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