Skip to content

Commit 00ce6a3

Browse files
nimit95targos
authored andcommittedApr 22, 2020
doc: add useful v8 option section
This adds new section for v8 options and --max-old-space-size Fixes: #32252 PR-URL: #32262 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
1 parent f9d9414 commit 00ce6a3

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed
 

‎doc/api/cli.md

+24
Original file line numberDiff line numberDiff line change
@@ -1384,6 +1384,30 @@ threadpool by setting the `'UV_THREADPOOL_SIZE'` environment variable to a value
13841384
greater than `4` (its current default value). For more information, see the
13851385
[libuv threadpool documentation][].
13861386

1387+
## Useful V8 options
1388+
1389+
V8 has its own set of CLI options. Any V8 CLI option that is provided to `node`
1390+
will be passed on to V8 to handle. V8's options have _no stability guarantee_.
1391+
The V8 team themselves don't consider them to be part of their formal API,
1392+
and reserve the right to change them at any time. Likewise, they are not
1393+
covered by the Node.js stability guarantees. Many of the V8
1394+
options are of interest only to V8 developers. Despite this, there is a small
1395+
set of V8 options that are widely applicable to Node.js, and they are
1396+
documented here:
1397+
1398+
### `--max-old-space-size=SIZE` (in Mbytes)
1399+
1400+
Sets the max memory size of V8's old memory section. As memory
1401+
consumption approaches the limit, V8 will spend more time on
1402+
garbage collection in an effort to free unused memory.
1403+
1404+
On a machine with 2GB of memory, consider setting this to
1405+
1536 (1.5GB) to leave some memory for other uses and avoid swapping.
1406+
1407+
```console
1408+
$ node --max-old-space-size=1536 index.js
1409+
```
1410+
13871411
[`--openssl-config`]: #cli_openssl_config_file
13881412
[`Buffer`]: buffer.html#buffer_class_buffer
13891413
[`SlowBuffer`]: buffer.html#buffer_class_slowbuffer

0 commit comments

Comments
 (0)
Please sign in to comment.