-
-
Notifications
You must be signed in to change notification settings - Fork 35.4k
doc: Add useful V8 option section #32262
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
0090f54
5209db8
2e86534
2f36d8d
0cf3b11
030fe45
6208729
fd93229
aafe9fd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
This adds new section for v8 options and --max-old-space-size Fixes: #32252
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -1180,6 +1180,8 @@ V8 options that are allowed are: | |||||||||||||||||||
| `--perf-basic-prof-only-functions`, `--perf-basic-prof`, | ||||||||||||||||||||
| `--perf-prof-unwinding-info`, and `--perf-prof` are only available on Linux. | ||||||||||||||||||||
|
|
||||||||||||||||||||
| ### Useful v8 Options | ||||||||||||||||||||
| ## | ||||||||||||||||||||
| ### `NODE_PATH=path[:…]` | ||||||||||||||||||||
| <!-- YAML | ||||||||||||||||||||
| added: v0.1.32 | ||||||||||||||||||||
|
|
@@ -1385,6 +1387,20 @@ threadpool by setting the `'UV_THREADPOOL_SIZE'` environment variable to a value | |||||||||||||||||||
| greater than `4` (its current default value). For more information, see the | ||||||||||||||||||||
| [libuv threadpool documentation][]. | ||||||||||||||||||||
|
|
||||||||||||||||||||
| ## Useful v8 Options | ||||||||||||||||||||
|
|
||||||||||||||||||||
| These are v8 options and fall outside Node.js' responsibility. | ||||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
I think we should say something like the above. |
||||||||||||||||||||
|
|
||||||||||||||||||||
| V8 options that are allowed are: | ||||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this should either be removed completely or at least reworded. Node does not restrict the V8 options that can be passed on the command line.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There is another place in the document mentioning the same thing. |
||||||||||||||||||||
|
|
||||||||||||||||||||
| ### `--max-old-space-size` | ||||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||||||
|
|
||||||||||||||||||||
| Sets the max memory size of V8 old memory section. As memory consumption approaches the limit, V8 will spend more time on garbage collection in an effort to free unused memory. | ||||||||||||||||||||
|
|
||||||||||||||||||||
| On a machine with 2GB of memory it suggested to set 1.5GB to leave some memory for other uses and avoid swapping. | ||||||||||||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
nit: need to wrap lines at <= 80 chars |
||||||||||||||||||||
|
|
||||||||||||||||||||
| E.g. `node --max-old-space-size=1536 index.js` | ||||||||||||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Optional nit: Delete this line.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I personally feel an example helps a lot when being introduced to a flag. It clearly shows how to pass an argument. @Trott
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
If we want to provide an example, it should conform with the formatting of the other examples provided elsewhere in the doc. Otherwise, each entry is inventing its own example formatting, and we definitely do not want that. The existing format is more useful than this as it provides context, such as what the anticipated output might look like. So, this example might show the error one might get if running without the flag, then show the command succeeding with the flag. (That said, most of our entries do not contain examples and that seems appropriate in this document.)
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Totally agree with your point, Can you point me to some of the correct existing formats?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't mean the format of the command itself. I mean the markdown formatting that denotes an example. ```console
$ node --cpu-prof index.js
$ ls *.cpuprofile
CPU.20190409.202950.15293.0.0.cpuprofile
```
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @Trott can you check out the formatting once now. |
||||||||||||||||||||
|
|
||||||||||||||||||||
| [`--openssl-config`]: #cli_openssl_config_file | ||||||||||||||||||||
| [`Buffer`]: buffer.html#buffer_class_buffer | ||||||||||||||||||||
| [`SlowBuffer`]: buffer.html#buffer_class_slowbuffer | ||||||||||||||||||||
|
|
||||||||||||||||||||
Uh oh!
There was an error while loading. Please reload this page.