Skip to content

Commit

Permalink
doc: clarify --max-old-space-size and --max-semi-space-size units
Browse files Browse the repository at this point in the history
PR-URL: #54477
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Ulises Gascón <ulisesgascongonzalez@gmail.com>
  • Loading branch information
alexandre-abrioux authored and targos committed Oct 2, 2024
1 parent e2bab0f commit 62953ef
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
14 changes: 11 additions & 3 deletions doc/api/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -3213,7 +3213,11 @@ documented here:

### `--perf-prof-unwinding-info`

### `--max-old-space-size=SIZE` (in megabytes)
<!-- Anchor to make sure old links find a target -->

<a id="--max-old-space-sizesize-in-megabytes"></a>

### `--max-old-space-size=SIZE` (in MiB)

Sets the max memory size of V8's old memory section. As memory
consumption approaches the limit, V8 will spend more time on
Expand All @@ -3226,10 +3230,14 @@ On a machine with 2 GiB of memory, consider setting this to
node --max-old-space-size=1536 index.js
```

### `--max-semi-space-size=SIZE` (in megabytes)
<!-- Anchor to make sure old links find a target -->

<a id="--max-semi-space-sizesize-in-megabytes"></a>

### `--max-semi-space-size=SIZE` (in MiB)

Sets the maximum [semi-space][] size for V8's [scavenge garbage collector][] in
MiB (megabytes).
MiB (mebibytes).
Increasing the max size of a semi-space may improve throughput for Node.js at
the cost of more memory consumption.

Expand Down
4 changes: 2 additions & 2 deletions doc/api/worker_threads.md
Original file line number Diff line number Diff line change
Expand Up @@ -1354,8 +1354,8 @@ thread spawned will spawn another until the application crashes.
[`'close'` event]: #event-close
[`'exit'` event]: #event-exit
[`'online'` event]: #event-online
[`--max-old-space-size`]: cli.md#--max-old-space-sizesize-in-megabytes
[`--max-semi-space-size`]: cli.md#--max-semi-space-sizesize-in-megabytes
[`--max-old-space-size`]: cli.md#--max-old-space-sizesize-in-mib
[`--max-semi-space-size`]: cli.md#--max-semi-space-sizesize-in-mib
[`ArrayBuffer`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer
[`AsyncResource`]: async_hooks.md#class-asyncresource
[`Buffer.allocUnsafe()`]: buffer.md#static-method-bufferallocunsafesize
Expand Down

0 comments on commit 62953ef

Please sign in to comment.