Skip to content

Commit a215c89

Browse files
committed
cli: add --expose-gc flag available to NODE_OPTIONS
This commits allows users to send `--expose-gc` via `NODE_OPTIONS` environment variable. Using `node --expose-gc` is possible but via `NODE_OPTIONS` won't work. ```sh NODE_OPTIONS='--expose-gc' node node: --expose-gc is not allowed in NODE_OPTIONS ``` Signed-off-by: Juan José Arboleda <[email protected]>
1 parent cb90a31 commit a215c89

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

doc/api/cli.md

+2
Original file line numberDiff line numberDiff line change
@@ -3118,6 +3118,8 @@ documented here:
31183118

31193119
### `--max-old-space-size=SIZE` (in megabytes)
31203120

3121+
### `--expose-gc`
3122+
31213123
Sets the max memory size of V8's old memory section. As memory
31223124
consumption approaches the limit, V8 will spend more time on
31233125
garbage collection in an effort to free unused memory.

src/node_options.cc

+1
Original file line numberDiff line numberDiff line change
@@ -473,6 +473,7 @@ EnvironmentOptionsParser::EnvironmentOptionsParser() {
473473
AddOption("--experimental-report", "", NoOp{}, kAllowedInEnvvar);
474474
AddOption(
475475
"--experimental-wasi-unstable-preview1", "", NoOp{}, kAllowedInEnvvar);
476+
AddOption("--expose-gc", "expose gc extension", V8Option{}, kAllowedInEnvvar);
476477
AddOption("--expose-internals", "", &EnvironmentOptions::expose_internals);
477478
AddOption("--frozen-intrinsics",
478479
"experimental frozen intrinsics support",

0 commit comments

Comments
 (0)