From 79fdc6bea37816f198ab566bbc5d9b754116eea8 Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Fri, 13 Mar 2020 17:28:19 +0100 Subject: [PATCH] cli: allow --huge-max-old-generation-size in NODE_OPTIONS MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/32251 Reviewed-By: Colin Ihrig Reviewed-By: James M Snell Reviewed-By: Michaƫl Zasso Reviewed-By: David Carlier --- doc/api/cli.md | 1 + src/node_options.cc | 5 +++++ test/parallel/test-cli-node-options.js | 1 + 3 files changed, 7 insertions(+) diff --git a/doc/api/cli.md b/doc/api/cli.md index c68181bff863cc..b4ac6ca67d3532 100644 --- a/doc/api/cli.md +++ b/doc/api/cli.md @@ -1196,6 +1196,7 @@ V8 options that are allowed are: * `--abort-on-uncaught-exception` * `--disallow-code-generation-from-strings` +* `--huge-max-old-generation-size` * `--interpreted-frames-native-stack` * `--jitless` * `--max-old-space-size` diff --git a/src/node_options.cc b/src/node_options.cc index 4d3378b26a1159..fe6f0f24d31384 100644 --- a/src/node_options.cc +++ b/src/node_options.cc @@ -569,6 +569,11 @@ PerIsolateOptionsParser::PerIsolateOptionsParser( "disallow eval and friends", V8Option{}, kAllowedInEnvironment); + AddOption("--huge-max-old-generation-size", + "increase default maximum heap size on machines with 16GB memory " + "or more", + V8Option{}, + kAllowedInEnvironment); AddOption("--jitless", "disable runtime allocation of executable memory", V8Option{}, diff --git a/test/parallel/test-cli-node-options.js b/test/parallel/test-cli-node-options.js index 0bbe4c9eae1ba2..2fc22ca477ce94 100644 --- a/test/parallel/test-cli-node-options.js +++ b/test/parallel/test-cli-node-options.js @@ -67,6 +67,7 @@ if (common.hasCrypto) { // V8 options expect('--abort_on-uncaught_exception', 'B\n'); expect('--disallow-code-generation-from-strings', 'B\n'); +expect('--huge-max-old-generation-size', 'B\n'); expect('--jitless', 'B\n'); expect('--max-old-space-size=0', 'B\n'); expect('--stack-trace-limit=100',