Skip to content

Commit f0f0291

Browse files
Asaf-Federmanaduh95
authored andcommitted
test,doc: skip --max-old-space-size-percentage on 32-bit platforms
PR-URL: #60144 Reviewed-By: Richard Lau <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Ulises Gascón <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
1 parent 31a1c95 commit f0f0291

File tree

3 files changed

+16
-5
lines changed

3 files changed

+16
-5
lines changed

doc/api/cli.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1685,14 +1685,17 @@ changes:
16851685

16861686
Specify the maximum size, in bytes, of HTTP headers. Defaults to 16 KiB.
16871687

1688-
### `--max-old-space-size-percentage=PERCENTAGE`
1688+
### `--max-old-space-size-percentage=percentage`
16891689

1690-
Sets the max memory size of V8's old memory section as a percentage of available system memory.
1690+
Sets the maximum memory size of V8's old memory section as a percentage of available system memory.
16911691
This flag takes precedence over `--max-old-space-size` when both are specified.
16921692

1693-
The `PERCENTAGE` parameter must be a number greater than 0 and up to 100. representing the percentage
1693+
The `percentage` parameter must be a number greater than 0 and up to 100, representing the percentage
16941694
of available system memory to allocate to the V8 heap.
16951695

1696+
**Note:** This flag utilizes `--max-old-space-size`, which may be unreliable on 32-bit platforms due to
1697+
integer overflow issues.
1698+
16961699
```bash
16971700
# Using 50% of available system memory
16981701
node --max-old-space-size-percentage=50 index.js

doc/node.1

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,14 +333,18 @@ The file used to store localStorage data.
333333
Specify the maximum size of HTTP headers in bytes. Defaults to 16 KiB.
334334
.
335335
.It Fl -max-old-space-size-percentage Ns = Ns Ar percentage
336-
Sets the max memory size of V8's old memory section as a percentage of available system memory.
336+
Sets the maximum memory size of V8's old memory section as a percentage of available system memory.
337337
This flag takes precedence over
338338
.Fl -max-old-space-size
339339
when both are specified.
340340
The
341341
.Ar percentage
342342
parameter must be a number greater than 0 and up to 100, representing the percentage
343343
of available system memory to allocate to the V8 heap.
344+
.Pp
345+
Note: This flag utilizes
346+
.Fl -max-old-space-size ,
347+
which may be unreliable on 32-bit platforms due to integer overflow issues.
344348
.
345349
.It Fl -napi-modules
346350
This option is a no-op.

test/parallel/test-max-old-space-size-percentage.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,11 @@
22

33
// This test validates the --max-old-space-size-percentage flag functionality
44

5-
require('../common');
5+
const common = require('../common');
6+
// This flag utilizes --max-old-space-size, which is unreliable on
7+
// 32-bit platforms due to integer overflow issues.
8+
common.skipIf32Bits();
9+
610
const assert = require('node:assert');
711
const { spawnSync } = require('child_process');
812
const os = require('os');

0 commit comments

Comments
 (0)