From bec80892b324f55e030b354c87bfb011f28fff62 Mon Sep 17 00:00:00 2001 From: Alexandre ABRIOUX Date: Fri, 6 Sep 2024 19:33:03 +0200 Subject: [PATCH] doc: clarify `--max-old-space-size` and `--max-semi-space-size` units MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/54477 Reviewed-By: Tobias Nießen Reviewed-By: Luigi Pinca Reviewed-By: Ulises Gascón --- doc/api/cli.md | 14 +++++++++++--- doc/api/worker_threads.md | 4 ++-- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/doc/api/cli.md b/doc/api/cli.md index 1992bddb197..7e9051a5e67 100644 --- a/doc/api/cli.md +++ b/doc/api/cli.md @@ -3452,7 +3452,11 @@ documented here: ### `--perf-prof-unwinding-info` -### `--max-old-space-size=SIZE` (in megabytes) + + + + +### `--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 @@ -3465,10 +3469,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) + + + + +### `--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. diff --git a/doc/api/worker_threads.md b/doc/api/worker_threads.md index 2948ffeab72..b718a90f621 100644 --- a/doc/api/worker_threads.md +++ b/doc/api/worker_threads.md @@ -1500,8 +1500,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