Skip to content

Commit ad2c1bf

Browse files
test,doc: skip --max-old-space-size-percentage on 32-bit platforms
PR-URL: #60144 Reviewed-By: Richard Lau <richard.lau@ibm.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Ulises Gascón <ulisesgascongonzalez@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
1 parent db0121b commit ad2c1bf

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
@@ -1765,14 +1765,17 @@ changes:
17651765

17661766
Specify the maximum size, in bytes, of HTTP headers. Defaults to 16 KiB.
17671767

1768-
### `--max-old-space-size-percentage=PERCENTAGE`
1768+
### `--max-old-space-size-percentage=percentage`
17691769

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

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

1776+
**Note:** This flag utilizes `--max-old-space-size`, which may be unreliable on 32-bit platforms due to
1777+
integer overflow issues.
1778+
17761779
```bash
17771780
# Using 50% of available system memory
17781781
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
@@ -339,14 +339,18 @@ The file used to store localStorage data.
339339
Specify the maximum size of HTTP headers in bytes. Defaults to 16 KiB.
340340
.
341341
.It Fl -max-old-space-size-percentage Ns = Ns Ar percentage
342-
Sets the max memory size of V8's old memory section as a percentage of available system memory.
342+
Sets the maximum memory size of V8's old memory section as a percentage of available system memory.
343343
This flag takes precedence over
344344
.Fl -max-old-space-size
345345
when both are specified.
346346
The
347347
.Ar percentage
348348
parameter must be a number greater than 0 and up to 100, representing the percentage
349349
of available system memory to allocate to the V8 heap.
350+
.Pp
351+
Note: This flag utilizes
352+
.Fl -max-old-space-size ,
353+
which may be unreliable on 32-bit platforms due to integer overflow issues.
350354
.
351355
.It Fl -napi-modules
352356
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)