From 9b6b567bc4dd8f40bad12528eebf12dac8a8027f Mon Sep 17 00:00:00 2001 From: cjihrig Date: Mon, 8 Apr 2019 10:20:26 -0400 Subject: [PATCH] lib,src,doc: add --heapsnapshot-signal CLI flag This flag allows heap snapshots to be captured without modifying application code. PR-URL: https://github.com/nodejs/node/pull/27133 Reviewed-By: James M Snell Reviewed-By: Sam Roberts Reviewed-By: Richard Lau Reviewed-By: Anna Henningsen --- doc/api/cli.md | 9 ++++++ doc/node.1 | 3 ++ lib/internal/bootstrap/pre_execution.js | 16 ++++++++++ src/node_options.cc | 4 +++ src/node_options.h | 1 + test/sequential/test-heapdump-flag.js | 41 +++++++++++++++++++++++++ 6 files changed, 74 insertions(+) create mode 100644 test/sequential/test-heapdump-flag.js diff --git a/doc/api/cli.md b/doc/api/cli.md index ced8cece1d57f0..60d75a6c04baef 100644 --- a/doc/api/cli.md +++ b/doc/api/cli.md @@ -230,6 +230,14 @@ https://github.com/tc39/ecma262/pull/1320. Both of the above may change in future updates, which will be breaking changes. +### `--heapsnapshot-signal=signal` + + +Generates a heap snapshot each time the process receives the specified signal. +`signal` must be a valid signal name. Disabled by default. + ### `--http-parser=library`