diff --git a/doc/api/cli.md b/doc/api/cli.md index f24b7f44e5..cb02d67719 100644 --- a/doc/api/cli.md +++ b/doc/api/cli.md @@ -1765,14 +1765,17 @@ changes: Specify the maximum size, in bytes, of HTTP headers. Defaults to 16 KiB. -### `--max-old-space-size-percentage=PERCENTAGE` +### `--max-old-space-size-percentage=percentage` -Sets the max memory size of V8's old memory section as a percentage of available system memory. +Sets the maximum memory size of V8's old memory section as a percentage of available system memory. This flag takes precedence over `--max-old-space-size` when both are specified. -The `PERCENTAGE` parameter must be a number greater than 0 and up to 100. representing the percentage +The `percentage` parameter must be a number greater than 0 and up to 100, representing the percentage of available system memory to allocate to the V8 heap. +**Note:** This flag utilizes `--max-old-space-size`, which may be unreliable on 32-bit platforms due to +integer overflow issues. + ```bash # Using 50% of available system memory node --max-old-space-size-percentage=50 index.js diff --git a/doc/node.1 b/doc/node.1 index d69e58fb3a..ba9af3ac6a 100644 --- a/doc/node.1 +++ b/doc/node.1 @@ -339,7 +339,7 @@ The file used to store localStorage data. Specify the maximum size of HTTP headers in bytes. Defaults to 16 KiB. . .It Fl -max-old-space-size-percentage Ns = Ns Ar percentage -Sets the max memory size of V8's old memory section as a percentage of available system memory. +Sets the maximum memory size of V8's old memory section as a percentage of available system memory. This flag takes precedence over .Fl -max-old-space-size when both are specified. @@ -347,6 +347,10 @@ The .Ar percentage parameter must be a number greater than 0 and up to 100, representing the percentage of available system memory to allocate to the V8 heap. +.Pp +Note: This flag utilizes +.Fl -max-old-space-size , +which may be unreliable on 32-bit platforms due to integer overflow issues. . .It Fl -napi-modules This option is a no-op. diff --git a/test/parallel/test-max-old-space-size-percentage.js b/test/parallel/test-max-old-space-size-percentage.js index e55c426d7e..d4da10b301 100644 --- a/test/parallel/test-max-old-space-size-percentage.js +++ b/test/parallel/test-max-old-space-size-percentage.js @@ -2,7 +2,11 @@ // This test validates the --max-old-space-size-percentage flag functionality -require('../common'); +const common = require('../common'); +// This flag utilizes --max-old-space-size, which is unreliable on +// 32-bit platforms due to integer overflow issues. +common.skipIf32Bits(); + const assert = require('node:assert'); const { spawnSync } = require('child_process'); const os = require('os');