diff options
author | Jamie Davis <davisjam@vt.edu> | 2018-06-09 21:29:51 +0300 |
---|---|---|
committer | James M Snell <jasnell@gmail.com> | 2018-06-21 17:20:58 +0300 |
commit | 25e5ae41688676a5fd29b2e2e7602168eee4ceb5 (patch) | |
tree | 8efacb90a8a506cfd21663a9b6181ccc2f433b37 /doc/api/child_process.md | |
parent | 2066cd42b63bb34b1905f9bc60a55c9d1707d6a9 (diff) |
doc: note synchronous part of child_process.spawn
If an application has a large RSS (GB), jorangreef
observed that child_process.spawn will block the
event loop for ms-s.
This is surprising behavior and merits documentation.
Refs: https://github.com/nodejs/node/issues/14917
PR-URL: https://github.com/nodejs/node/pull/21234
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Diffstat (limited to 'doc/api/child_process.md')
-rw-r--r-- | doc/api/child_process.md | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/doc/api/child_process.md b/doc/api/child_process.md index 372f8bbaf44..e71bf89f913 100644 --- a/doc/api/child_process.md +++ b/doc/api/child_process.md @@ -661,6 +661,12 @@ child registers an event handler for the [`'disconnect'`][] event or the [`'message'`][] event. This allows the child to exit normally without the process being held open by the open IPC channel.* +On UNIX-like operating systems, the [`child_process.spawn()`][] method +performs memory operations synchronously before decoupling the event loop +from the child. Applications with a large memory footprint may find frequent +[`child_process.spawn()`][] calls to be a bottleneck. For more information, +see [V8 issue 7381](https://bugs.chromium.org/p/v8/issues/detail?id=7381). + See also: [`child_process.exec()`][] and [`child_process.fork()`][]. ## Synchronous Process Creation |