mirror of
https://github.com/zebrajr/node.git
synced 2026-01-15 12:15:26 +00:00
doc,worker: document resourceLimits overrides
If `--max-old-space-size` is passed on the command line, it takes precedence over `resourceLimits.maxOldSpaceSizeMb` passed to the worker thread. IMO this is a bug, but seems unlikely to change(?), so let's start by documenting it. See the attached issue for more details. Refs: https://github.com/nodejs/node/issues/43991 PR-URL: https://github.com/nodejs/node/pull/43992 Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
@@ -989,14 +989,17 @@ changes:
|
||||
are passed in `workerData`, a `transferList` is required for those
|
||||
items or [`ERR_MISSING_MESSAGE_PORT_IN_TRANSFER_LIST`][] is thrown.
|
||||
See [`port.postMessage()`][] for more information.
|
||||
* `resourceLimits` {Object} An optional set of resource limits for the new
|
||||
JS engine instance. Reaching these limits leads to termination of the
|
||||
`Worker` instance. These limits only affect the JS engine, and no external
|
||||
data, including no `ArrayBuffer`s. Even if these limits are set, the process
|
||||
may still abort if it encounters a global out-of-memory situation.
|
||||
* `maxOldGenerationSizeMb` {number} The maximum size of the main heap in MB.
|
||||
* `resourceLimits` {Object} An optional set of resource limits for the new JS
|
||||
engine instance. Reaching these limits leads to termination of the `Worker`
|
||||
instance. These limits only affect the JS engine, and no external data,
|
||||
including no `ArrayBuffer`s. Even if these limits are set, the process may
|
||||
still abort if it encounters a global out-of-memory situation.
|
||||
* `maxOldGenerationSizeMb` {number} The maximum size of the main heap in
|
||||
MB. If the command-line argument [`--max-old-space-size`][] is set, it
|
||||
overrides this setting.
|
||||
* `maxYoungGenerationSizeMb` {number} The maximum size of a heap space for
|
||||
recently created objects.
|
||||
recently created objects. If the command-line argument
|
||||
[`--max-semi-space-size`][] is set, it overrides this setting.
|
||||
* `codeRangeSizeMb` {number} The size of a pre-allocated memory range
|
||||
used for generated code.
|
||||
* `stackSizeMb` {number} The default maximum stack size for the thread.
|
||||
@@ -1334,6 +1337,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
|
||||
[`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
|
||||
|
||||
Reference in New Issue
Block a user