cli: add --node-memory-debug option

Add a public switch that turns on features for debugging memory
leaks inside of Node.js core.

PR-URL: https://github.com/nodejs/node/pull/35537
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Michael Dawson <midawson@redhat.com>
This commit is contained in:
Anna Henningsen authored and Myles Borins committed 2021-08-31 10:54:55 -04:00
1 parent 8b9215d07c
commit 39eba0a2e1
3 files changed
+19

No files matched your search

+9
View File
@@ -537,6 +537,14 @@ added: v6.0.0
Silence all process warnings (including deprecations).
### `--node-memory-debug`
<!-- YAML
added: REPLACEME
-->
Enable extra debug checks for memory leaks in Node.js internals. This is
usually only useful for developers debugging Node.js itself.
### `--openssl-config=file`
<!-- YAML
added: v6.9.0
@@ -1278,6 +1286,7 @@ Node.js options that are allowed are:
* `--no-deprecation`
* `--no-force-async-hooks-checks`
* `--no-warnings`
* `--node-memory-debug`
* `--openssl-config`
* `--pending-deprecation`
* `--policy-integrity`
+4
View File
@@ -281,6 +281,10 @@ These will still be enabled dynamically when `async_hooks` is enabled.
.It Fl -no-warnings
Silence all process warnings (including deprecations).
.
.It Fl -node-memory-debug
Enable extra debug checks for memory leaks in Node.js internals. This is
usually only useful for developers debugging Node.js itself.
.
.It Fl -openssl-config Ns = Ns Ar file
Load an OpenSSL configuration file on startup.
Among other uses, this can be used to enable FIPS-compliant crypto if Node.js is built with
+6
View File
@@ -770,6 +770,12 @@ PerProcessOptionsParser::PerProcessOptionsParser(
kAllowedInEnvironment);
Insert(iop, &PerProcessOptions::get_per_isolate_options);
AddOption("--node-memory-debug",
"Run with extra debug checks for memory leaks in Node.js itself",
NoOp{}, kAllowedInEnvironment);
Implies("--node-memory-debug", "--debug-arraybuffer-allocations");
Implies("--node-memory-debug", "--verify-base-objects");
}
inline std::string RemoveBrackets(const std::string& host) {