diff --git a/doc/api/cli.md b/doc/api/cli.md index fe680b06a3b949..73d8fb3191e3f0 100644 --- a/doc/api/cli.md +++ b/doc/api/cli.md @@ -1702,6 +1702,25 @@ changes: Specify the maximum size, in bytes, of HTTP headers. Defaults to 16 KiB. +### `--max-old-space-size-percentage=percentage` + +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 +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 + +# Using 75% of available system memory +node --max-old-space-size-percentage=75 index.js +``` + ### `--napi-modules`